Skip to content

Commit

Permalink
rename secret route with workspace and environment hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Jan 1, 2023
1 parent f015e6b commit 939e9ba
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/src/routes/v2/secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ router.post(
})

const [bulkCreateError, newlyCreatedSecrets] = await to(Secret.insertMany(sanitizedSecretesToCreate).then())

if (bulkCreateError) {
if (bulkCreateError instanceof ValidationError) {
throw RouteValidationError({ message: bulkCreateError.message, stack: bulkCreateError.stack })
Expand All @@ -64,7 +63,7 @@ router.post(
throw InternalServerError({ message: "Unable to process your batch create request. Please try again", stack: bulkCreateError.stack })
}

res.status(200).send(newlyCreatedSecrets)
res.status(200).send()
}
);

Expand Down Expand Up @@ -134,7 +133,7 @@ router.delete(
* Apply modifications to many existing secrets in a given workspace and environment
*/
router.patch(
'/batch-modify/:workspaceId/:environmentName',
'/batch-modify/workspace/:workspaceId/environment/:environmentName',
requireAuth,
body('secrets').exists().isArray().custom((value) => value.every((item: ISecret) => typeof item === 'object')),
param('workspaceId').exists().isMongoId().trim(),
Expand Down

0 comments on commit 939e9ba

Please sign in to comment.