diff --git a/pages/actors/@actorId/edit/+Page.vue b/pages/actors/@actorId/edit/+Page.vue index 9fc95ab..5cc513e 100644 --- a/pages/actors/@actorId/edit/+Page.vue +++ b/pages/actors/@actorId/edit/+Page.vue @@ -657,7 +657,7 @@ const fields = computed(() => [ key: 'gender', type: 'select', value: actor.value.gender, - options: ['female', 'male', 'transsexual', 'other', null], + options: [null, 'female', 'male', 'transsexual', 'other'], inline: true, }, { diff --git a/src/actors.js b/src/actors.js index 5fd1574..019b685 100644 --- a/src/actors.js +++ b/src/actors.js @@ -752,7 +752,7 @@ export async function createActorRevision(actorId, { throw new HttpError(`No actor with ID ${actorId} found to update`, 404); } - if (openRevisions.length >= config.revisions.unapprovedLimit) { + if (openRevisions.length >= config.revisions.unapprovedLimit && reqUser.role !== 'admin') { throw new HttpError(`You have ${config.revisions.unapprovedLimit} unapproved revisions, please wait for approval before submitting another revision.`, 429); } @@ -788,7 +788,7 @@ export async function createActorRevision(actorId, { }).filter(Boolean)); const deltas = Object.entries(edits).map(([key, value]) => { - if (baseActor[key] === value) { + if (baseActor[key] === value || typeof value === 'undefined') { return null; } @@ -817,10 +817,7 @@ export async function createActorRevision(actorId, { }; } - return { - key, - value: value || null, - }; + return { key, value }; }).filter(Boolean); const deltaComments = deltas.map((delta) => delta.comment); diff --git a/src/scenes.js b/src/scenes.js index a4adedf..60dbfca 100644 --- a/src/scenes.js +++ b/src/scenes.js @@ -862,7 +862,7 @@ export async function createSceneRevision(sceneId, { edits, comment, apply }, re throw new HttpError(`No scene with ID ${sceneId} found to update`, 404); } - if (openRevisions.length >= config.revisions.unapprovedLimit) { + if (openRevisions.length >= config.revisions.unapprovedLimit && reqUser.role !== 'admin') { throw new HttpError(`You have ${config.revisions.unapprovedLimit} unapproved revisions, please wait for approval before submitting another revision.`, 429); } @@ -893,7 +893,7 @@ export async function createSceneRevision(sceneId, { edits, comment, apply }, re }).filter(Boolean)); const deltas = Object.entries(edits).map(([key, value]) => { - if (baseScene[key] === value) { + if (baseScene[key] === value || typeof value === 'undefined') { return null; }