diff --git a/core-api/src/routes/live-object-version/liveObjectVersionPayloads.ts b/core-api/src/routes/live-object-version/liveObjectVersionPayloads.ts index 4fbc1c3d..79ee59bf 100644 --- a/core-api/src/routes/live-object-version/liveObjectVersionPayloads.ts +++ b/core-api/src/routes/live-object-version/liveObjectVersionPayloads.ts @@ -145,7 +145,7 @@ export function parseGetLiveObjectVersionPayload( export function parseLovRecordCountsPayload(data: StringKeyMap): ValidatedPayload { const ids = data?.ids || [] - if (!ids.length) { + if (!ids.length || ids.includes(null)) { return { isValid: false, error: '"ids" was missing or empty' } } diff --git a/core-api/src/routes/namespace/namespacePayloads.ts b/core-api/src/routes/namespace/namespacePayloads.ts index 9dd731ca..83955fa5 100644 --- a/core-api/src/routes/namespace/namespacePayloads.ts +++ b/core-api/src/routes/namespace/namespacePayloads.ts @@ -25,7 +25,7 @@ export function parseGetNamespacePayload(data: StringKeyMap): ValidatedPayload { const nsps = data?.nsps || [] - if (!nsps.length) { + if (!nsps.length || nsps.includes(null)) { return { isValid: false, error: '"nsps" was missing or empty' } } diff --git a/shared/src/lib/core/db/services/liveObjectVersionServices.ts b/shared/src/lib/core/db/services/liveObjectVersionServices.ts index 31b4a92e..66c7fed5 100644 --- a/shared/src/lib/core/db/services/liveObjectVersionServices.ts +++ b/shared/src/lib/core/db/services/liveObjectVersionServices.ts @@ -277,13 +277,18 @@ export async function resolveLovWithPartialId(someId: string): Promise { try { const lovs = await liveObjectVersions().find({ + relations: { + liveObject: true, + }, select: { config: { table: true, }, }, where: { - uid: In(uids), + liveObject: { + uid: In(uids), + }, }, }) return lovs.map((lov) => lov.config.table)