From 2cf47f3224bc1de4063ea8a66160057cf74c8f0c Mon Sep 17 00:00:00 2001 From: Lucky3028 Date: Tue, 26 Sep 2023 00:20:43 +0900 Subject: [PATCH] fix: add nest --- apps/auto-run-ac-api/src/api/defaultTriggers.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/auto-run-ac-api/src/api/defaultTriggers.ts b/apps/auto-run-ac-api/src/api/defaultTriggers.ts index 5ea7e6a..a784994 100644 --- a/apps/auto-run-ac-api/src/api/defaultTriggers.ts +++ b/apps/auto-run-ac-api/src/api/defaultTriggers.ts @@ -56,7 +56,11 @@ export const defaultTriggersApi = app responses: { 201: { description: 'Trigger is created', - content: { 'application/json': { schema: z.object({ success: z.boolean(), data: defaultTriggerSchema }) } }, + content: { + 'application/json': { + schema: z.object({ success: z.boolean(), data: z.object({ trigger: defaultTriggerSchema }) }), + }, + }, }, }, method: 'post', @@ -77,7 +81,8 @@ export const defaultTriggersApi = app operationMode: contents.ac.mode, }) .onConflictDoNothing(); - const response = { success: true, data: { ...contents, id } }; + const trigger = { ...contents, id }; + const response = { success: true, data: { trigger } }; return c.jsonT(response, 201, { Location: `${getUrl(c.req)}/${id}` }); },