mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 18:15:53 +00:00
feat: implemented ui and api for managing user,identity metadata
This commit is contained in:
@@ -67,12 +67,13 @@ export const useCreateIdentity = () => {
|
||||
export const useUpdateIdentity = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation<Identity, {}, UpdateIdentityDTO>({
|
||||
mutationFn: async ({ identityId, name, role }) => {
|
||||
mutationFn: async ({ identityId, name, role, metadata }) => {
|
||||
const {
|
||||
data: { identity }
|
||||
} = await apiRequest.patch(`/api/v1/identities/${identityId}`, {
|
||||
name,
|
||||
role
|
||||
role,
|
||||
metadata
|
||||
});
|
||||
|
||||
return identity;
|
||||
|
||||
@@ -37,6 +37,7 @@ export type IdentityMembershipOrg = {
|
||||
id: string;
|
||||
identity: Identity;
|
||||
organization: string;
|
||||
metadata: { key: string; value: string; id: string }[];
|
||||
role: "admin" | "member" | "viewer" | "no-access" | "custom";
|
||||
customRole?: TOrgRole;
|
||||
createdAt: string;
|
||||
@@ -79,6 +80,7 @@ export type CreateIdentityDTO = {
|
||||
name: string;
|
||||
organizationId: string;
|
||||
role?: string;
|
||||
metadata?: { key: string; value: string }[];
|
||||
};
|
||||
|
||||
export type UpdateIdentityDTO = {
|
||||
@@ -86,6 +88,7 @@ export type UpdateIdentityDTO = {
|
||||
name?: string;
|
||||
role?: string;
|
||||
organizationId: string;
|
||||
metadata?: { key: string; value: string }[];
|
||||
};
|
||||
|
||||
export type DeleteIdentityDTO = {
|
||||
|
||||
@@ -235,12 +235,13 @@ export const useUpdateOrgMembership = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<{}, {}, UpdateOrgMembershipDTO>({
|
||||
mutationFn: ({ organizationId, membershipId, role, isActive }) => {
|
||||
mutationFn: ({ organizationId, membershipId, role, isActive, metadata }) => {
|
||||
return apiRequest.patch(
|
||||
`/api/v2/organizations/${organizationId}/memberships/${membershipId}`,
|
||||
{
|
||||
role,
|
||||
isActive
|
||||
isActive,
|
||||
metadata
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
@@ -46,6 +46,7 @@ export type UserEnc = {
|
||||
|
||||
export type OrgUser = {
|
||||
id: string;
|
||||
metadata: { key: string; value: string; id: string }[];
|
||||
user: {
|
||||
username: string;
|
||||
email?: string;
|
||||
@@ -142,6 +143,7 @@ export type UpdateOrgMembershipDTO = {
|
||||
membershipId: string;
|
||||
role?: string;
|
||||
isActive?: boolean;
|
||||
metadata?: { key: string; value: string }[];
|
||||
};
|
||||
|
||||
export type DeletOrgMembershipDTO = {
|
||||
|
||||
Reference in New Issue
Block a user