Fixed false not accepted as actor edit value.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user