Skip to content

Commit

Permalink
fix new public API handler
Browse files Browse the repository at this point in the history
  • Loading branch information
valya committed Aug 6, 2024
1 parent 2bd8650 commit d01f90e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@ export = {
transferCredential: [
projectScope('credential:move', 'credential'),
async (req: CredentialRequest.Transfer, res: express.Response) => {
const body = z.object({ destinationProjectId: z.string() }).parse(req.body);
const body = z
.object({
destinationProjectId: z.string(),
shareWithOriginalProject: z.boolean().optional(),
})
.parse(req.body);

await Container.get(EnterpriseCredentialsService).transferOne(
req.user,
req.params.workflowId,
body.destinationProjectId,
body.shareWithOriginalProject ?? false,
);

res.status(204).send();
Expand Down

0 comments on commit d01f90e

Please sign in to comment.