mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 13:26:31 +00:00
fix: use put instead of post and improve var naming
This commit is contained in:
@@ -38,7 +38,7 @@ export const registerExternalGroupOrgRoleMappingRouter = async (server: FastifyZ
|
|||||||
|
|
||||||
// update mappings for current org
|
// update mappings for current org
|
||||||
server.route({
|
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: "/",
|
url: "/",
|
||||||
config: {
|
config: {
|
||||||
rateLimit: writeLimit
|
rateLimit: writeLimit
|
||||||
|
|||||||
@@ -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");
|
const RESERVED_ORG_ROLE_SLUGS = Object.values(OrgMembershipRole).filter((role) => role !== "custom");
|
||||||
|
|
||||||
export const isCustomOrgRole = (membershipSlug: string) =>
|
export const isCustomOrgRole = (roleSlug: string) => !RESERVED_ORG_ROLE_SLUGS.includes(roleSlug as OrgMembershipRole);
|
||||||
!RESERVED_ORG_ROLE_SLUGS.includes(membershipSlug as OrgMembershipRole);
|
|
||||||
|
|
||||||
// this is only for updating an org
|
// this is only for updating an org
|
||||||
export const getDefaultOrgMembershipRoleForUpdateOrg = async ({
|
export const getDefaultOrgMembershipRoleForUpdateOrg = async ({
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const useUpdateExternalGroupOrgRoleMappings = () => {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: async (payload: TSyncExternalGroupOrgRoleMappingsDTO) => {
|
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;
|
return data;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user