Update MI authz logic

This commit is contained in:
Tuan Dang
2023-11-27 14:19:10 +07:00
parent 99c41bb63b
commit 6579b3c93f
15 changed files with 49 additions and 29 deletions
@@ -27,7 +27,7 @@ import { UsePopUpState } from "@app/hooks/usePopUp";
const schema = yup.object({
machineId: yup.string().required("Machine identity id is required"),
role: yup.string().required("Machine identity role is required")
role: yup.string()
}).required();
export type FormData = yup.InferType<typeof schema>;
@@ -85,10 +85,11 @@ export const AddMachineIdentityModal = ({
role
}: FormData) => {
try {
await addMachineToWorkspaceMutateAsync({
workspaceId,
machineId,
role
role: role || undefined
});
createNotification({