Do not store empty arrays
This commit is contained in:
parent
35ba5b93b5
commit
b7688d3a06
|
@ -82,11 +82,15 @@ export async function processInputBBReferences<
|
||||||
throw new InvalidBBRefError(notFoundIds[0], FieldSubtype.USER)
|
throw new InvalidBBRefError(notFoundIds[0], FieldSubtype.USER)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!referenceIds?.length) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
if (subtype === FieldSubtype.USERS) {
|
if (subtype === FieldSubtype.USERS) {
|
||||||
return referenceIds
|
return referenceIds
|
||||||
}
|
}
|
||||||
|
|
||||||
return referenceIds.join(",") || null
|
return referenceIds.join(",")
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
throw utils.unreachable(subtype)
|
throw utils.unreachable(subtype)
|
||||||
|
|
Loading…
Reference in New Issue