Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: use put instead of post and improve var naming

Scott Wilson44544e0491f8
diff --git a/backend/src/server/routes/v1/external-group-org-role-mapping-router.ts b/backend/src/server/routes/v1/external-group-org-role-mapping-router.ts
index b123376b0d..032deda7d3 100644
--- a/backend/src/server/routes/v1/external-group-org-role-mapping-router.ts
+++ b/backend/src/server/routes/v1/external-group-org-role-mapping-router.ts
@@ -38,7 +38,7 @@ export const registerExternalGroupOrgRoleMappingRouter = async (server: FastifyZ
// update mappings for current org
server.route({
- method: "POST", // using post since this endpoint creates, updates and deletes mappings
+ method: "PUT", // using put since this endpoint creates, updates and deletes mappings
url: "/",
config: {
rateLimit: writeLimit
diff --git a/backend/src/services/org/org-role-fns.ts b/backend/src/services/org/org-role-fns.ts
index 56818b2f91..f460e18a4d 100644
--- a/backend/src/services/org/org-role-fns.ts
+++ b/backend/src/services/org/org-role-fns.ts
@@ -5,8 +5,7 @@ import { TOrgRoleDALFactory } from "@app/services/org/org-role-dal";
const RESERVED_ORG_ROLE_SLUGS = Object.values(OrgMembershipRole).filter((role) => role !== "custom");
-export const isCustomOrgRole = (membershipSlug: string) =>
- !RESERVED_ORG_ROLE_SLUGS.includes(membershipSlug as OrgMembershipRole);
+export const isCustomOrgRole = (roleSlug: string) => !RESERVED_ORG_ROLE_SLUGS.includes(roleSlug as OrgMembershipRole);
// this is only for updating an org
export const getDefaultOrgMembershipRoleForUpdateOrg = async ({
diff --git a/frontend/src/hooks/api/externalGroupOrgRoleMappings/mutations.tsx b/frontend/src/hooks/api/externalGroupOrgRoleMappings/mutations.tsx
index e88d3acc7f..aac46726a1 100644
--- a/frontend/src/hooks/api/externalGroupOrgRoleMappings/mutations.tsx
+++ b/frontend/src/hooks/api/externalGroupOrgRoleMappings/mutations.tsx
@@ -8,7 +8,7 @@ export const useUpdateExternalGroupOrgRoleMappings = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async (payload: TSyncExternalGroupOrgRoleMappingsDTO) => {
- const { data } = await apiRequest.post("/api/v1/external-group-mappings", payload);
+ const { data } = await apiRequest.put("/api/v1/external-group-mappings", payload);
return data;
},