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
1 changed files with 4 additions and 11 deletions

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