From 431e29b41e3b8f45191e12028f0aefaa8fa5556b Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Thu, 18 Jul 2024 16:17:24 +0200 Subject: [PATCH] =?UTF-8?q?:children=5Fcrossing:=20(sheets)=20Auto=20set?= =?UTF-8?q?=20credentials=20after=20oauth=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/api/credentials/google-sheets/callback.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/builder/src/pages/api/credentials/google-sheets/callback.ts b/apps/builder/src/pages/api/credentials/google-sheets/callback.ts index 92da83439a..4158d7ad49 100644 --- a/apps/builder/src/pages/api/credentials/google-sheets/callback.ts +++ b/apps/builder/src/pages/api/credentials/google-sheets/callback.ts @@ -79,13 +79,15 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { return { ...group, blocks: group.blocks.map((block) => { - if (block.id !== blockId || !('options' in block)) return block + if (block.id !== blockId) return block return { ...block, - options: { - ...block.options, - credentialsId, - }, + options: + 'options' in block + ? { ...block.options, credentialsId } + : { + credentialsId, + }, } }), }