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, + }, } }), }