fix: unable to lock individual event type creation (#17668)

This commit is contained in:
Anik Dhabal Babu authored and GitHub committed 2024-11-15 15:58:19 -03:00
1 parent d294a74aad
commit e85c0e1a85
2 files changed
+13

No files matched your search

@@ -35,4 +35,13 @@ describe("Disallow undefined delete/update many", () => {
checkUndefinedInValue(where);
});
it("checkUndefinedInValue should not throw exception when the where object contain null values", async () => {
const where = {
teamId: null,
parentId: null,
};
checkUndefinedInValue(where);
});
});
@@ -12,6 +12,10 @@ export const checkUndefinedInValue = (where: any) => {
throw new Error(message);
}
if (whereInput === null) {
continue;
}
if (whereInput.hasOwnProperty("in") && typeof whereInput.in === "undefined") {
message = `The "in" value for the field "${key}" cannot be undefined.`;
throw new Error(message);