1
0
Fork 0
mirror of synced 2024-09-12 23:43:09 +12:00

Handle null or empty on processor

This commit is contained in:
Adria Navarro 2024-05-03 16:21:35 +02:00
parent ab647d1f0f
commit d91292f532

View file

@ -108,14 +108,9 @@ interface UserReferenceInfo {
}
export async function processOutputBBReference(
value: string,
value: string | null | undefined,
subtype: BBReferenceFieldSubType.USER
): Promise<UserReferenceInfo | undefined> {
if (value === null || value === undefined) {
// Already processed or nothing to process
return value || undefined
}
if (!value) {
return undefined
}
@ -148,14 +143,12 @@ export async function processOutputBBReference(
}
export async function processOutputBBReferences(
value: string,
value: string | null | undefined,
subtype: BBReferenceFieldSubType
): Promise<UserReferenceInfo[] | undefined> {
if (value === null || value === undefined) {
// Already processed or nothing to process
return value || undefined
if (!value) {
return undefined
}
const ids =
typeof value === "string" ? value.split(",").filter(id => !!id) : value