mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 12:26:13 +00:00
update secret import create notif
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
|
import { AxiosError } from "axios";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
||||||
@@ -78,12 +79,20 @@ export const CreateSecretImportForm = ({
|
|||||||
type: "success",
|
type: "success",
|
||||||
text: "Successfully linked"
|
text: "Successfully linked"
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (err) {
|
||||||
console.log(error);
|
console.error(err);
|
||||||
createNotification({
|
const axiosError = err as AxiosError
|
||||||
type: "error",
|
if (axiosError?.response?.status === 401) {
|
||||||
text: "Failed to link secrets"
|
createNotification({
|
||||||
});
|
text: "You do not have access to the selected environment/path",
|
||||||
|
type: "error"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
createNotification({
|
||||||
|
type: "error",
|
||||||
|
text: "Failed to link secrets"
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user