mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 19:26:19 +00:00
Merge pull request #1492 from akhilmhdh/fix/create-tag
This commit is contained in:
@@ -19,7 +19,7 @@ export const secretTagServiceFactory = ({ secretTagDAL, permissionService }: TSe
|
|||||||
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.Tags);
|
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.Tags);
|
||||||
|
|
||||||
const existingTag = await secretTagDAL.findOne({ slug });
|
const existingTag = await secretTagDAL.findOne({ slug, projectId });
|
||||||
if (existingTag) throw new BadRequestError({ message: "Tag already exist" });
|
if (existingTag) throw new BadRequestError({ message: "Tag already exist" });
|
||||||
|
|
||||||
const newTag = await secretTagDAL.create({
|
const newTag = await secretTagDAL.create({
|
||||||
|
|||||||
Reference in New Issue
Block a user