1
0
Fork 0
mirror of synced 2024-08-04 21:02:01 +12:00
This commit is contained in:
Adria Navarro 2024-04-25 16:40:13 +02:00
parent 1c4fc21870
commit 4b0e389526
2 changed files with 8 additions and 6 deletions

View file

@ -53,7 +53,8 @@
"ignoreRestSiblings": true "ignoreRestSiblings": true
} }
], ],
"local-rules/no-budibase-imports": "error" "no-redeclare": "off",
"@typescript-eslint/no-redeclare": "error"
} }
}, },
{ {

View file

@ -40,7 +40,7 @@ export async function processInputBBReferences<
subtype?: TS subtype?: TS
): Promise<string | string[] | null> { ): Promise<string | string[] | null> {
switch (type) { switch (type) {
case FieldType.BB_REFERENCE: case FieldType.BB_REFERENCE: {
let referenceIds: string[] = [] let referenceIds: string[] = []
if (Array.isArray(value)) { if (Array.isArray(value)) {
@ -95,7 +95,7 @@ export async function processInputBBReferences<
default: default:
throw utils.unreachable(subtype) throw utils.unreachable(subtype)
} }
}
case FieldType.BB_REFERENCE_SINGLE: { case FieldType.BB_REFERENCE_SINGLE: {
if (value && Array.isArray(value)) { if (value && Array.isArray(value)) {
throw "BB_REFERENCE_SINGLE cannot be an array" throw "BB_REFERENCE_SINGLE cannot be an array"
@ -149,7 +149,7 @@ export async function processOutputBBReferences(
} }
switch (type) { switch (type) {
case FieldType.BB_REFERENCE: case FieldType.BB_REFERENCE: {
const ids = const ids =
typeof value === "string" ? value.split(",").filter(id => !!id) : value typeof value === "string" ? value.split(",").filter(id => !!id) : value
@ -174,8 +174,8 @@ export async function processOutputBBReferences(
default: default:
throw utils.unreachable(subtype) throw utils.unreachable(subtype)
} }
}
case FieldType.BB_REFERENCE_SINGLE: case FieldType.BB_REFERENCE_SINGLE: {
if (!value) { if (!value) {
return undefined return undefined
} }
@ -199,6 +199,7 @@ export async function processOutputBBReferences(
firstName: user.firstName, firstName: user.firstName,
lastName: user.lastName, lastName: user.lastName,
} }
}
default: default:
throw utils.unreachable(type) throw utils.unreachable(type)