From d5fd635d6c308ffd7534695cd4d29afae9538917 Mon Sep 17 00:00:00 2001 From: adrinr Date: Fri, 24 Feb 2023 11:26:05 +0100 Subject: [PATCH] Remove @ts-ignore --- packages/server/src/api/controllers/row/ExternalRequest.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index f60d1b83ab..c3b7636636 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -613,14 +613,13 @@ export class ExternalRequest { const { key, tableId, isUpdate, id, ...rest } = relationship const body: { [key: string]: any } = processObjectSync(rest, row, {}) const linkTable = this.getTable(tableId) - // @ts-ignore - const linkPrimary = linkTable?.primary[0] + const relationshipPrimary = linkTable?.primary || [] + const linkPrimary = relationshipPrimary[0] if (!linkTable || !linkPrimary) { return } - // @ts-ignore - const linkSecondary = linkTable?.primary[1] + const linkSecondary = relationshipPrimary[1] const rows = related[key]?.rows || []