mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #2311 from Infisical/daniel/read-secrets-notification-removal
Fix: Remove notification when unable to read secrets from environment
This commit is contained in:
1
frontend/src/hooks/api/secrets/constants.ts
Normal file
1
frontend/src/hooks/api/secrets/constants.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const ERROR_NOT_ALLOWED_READ_SECRETS = "You are not allowed to read on secrets";
|
||||||
@@ -7,6 +7,7 @@ import { createNotification } from "@app/components/notifications";
|
|||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
import { useToggle } from "@app/hooks/useToggle";
|
import { useToggle } from "@app/hooks/useToggle";
|
||||||
|
|
||||||
|
import { ERROR_NOT_ALLOWED_READ_SECRETS } from "./constants";
|
||||||
import {
|
import {
|
||||||
GetSecretVersionsDTO,
|
GetSecretVersionsDTO,
|
||||||
SecretType,
|
SecretType,
|
||||||
@@ -135,11 +136,13 @@ export const useGetProjectSecretsAllEnv = ({
|
|||||||
onError: (error: unknown) => {
|
onError: (error: unknown) => {
|
||||||
if (axios.isAxiosError(error) && !isErrorHandled) {
|
if (axios.isAxiosError(error) && !isErrorHandled) {
|
||||||
const serverResponse = error.response?.data as { message: string };
|
const serverResponse = error.response?.data as { message: string };
|
||||||
createNotification({
|
if (serverResponse.message !== ERROR_NOT_ALLOWED_READ_SECRETS) {
|
||||||
title: "Error fetching secrets",
|
createNotification({
|
||||||
type: "error",
|
title: "Error fetching secrets",
|
||||||
text: serverResponse.message
|
type: "error",
|
||||||
});
|
text: serverResponse.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setIsErrorHandled.on();
|
setIsErrorHandled.on();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user