Fixed false not accepted as actor edit value.
This commit is contained in:
parent
fabd57bbef
commit
eb4234e978
|
@ -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,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue