traxxx-web/src/revisions.js

25 lines
637 B
JavaScript
Raw Normal View History

2024-10-22 01:12:42 +00:00
export function curateRevision(revision) {
return {
id: revision.id,
sceneId: revision.scene_id,
actorId: revision.actor_id,
base: revision.base,
deltas: revision.deltas,
hash: revision.hash,
comment: revision.comment,
user: revision.user_id && {
id: revision.user_id,
username: revision.username,
},
review: typeof revision.approved === 'boolean' ? {
isApproved: revision.approved,
userId: revision.reviewed_by,
username: revision.reviewer_username,
reviewedAt: revision.reviewed_at,
} : null,
appliedAt: revision.applied_at,
failed: revision.failed,
createdAt: revision.created_at,
};
}