Skip to content

Commit

Permalink
fix: add nest
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky3028 committed Sep 25, 2023
1 parent 3af5b78 commit 2cf47f3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/auto-run-ac-api/src/api/defaultTriggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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}` });
},
Expand Down

0 comments on commit 2cf47f3

Please sign in to comment.