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 { useToggle } from "@app/hooks/useToggle";
|
||||
|
||||
import { ERROR_NOT_ALLOWED_READ_SECRETS } from "./constants";
|
||||
import {
|
||||
GetSecretVersionsDTO,
|
||||
SecretType,
|
||||
@@ -135,11 +136,13 @@ export const useGetProjectSecretsAllEnv = ({
|
||||
onError: (error: unknown) => {
|
||||
if (axios.isAxiosError(error) && !isErrorHandled) {
|
||||
const serverResponse = error.response?.data as { message: string };
|
||||
createNotification({
|
||||
title: "Error fetching secrets",
|
||||
type: "error",
|
||||
text: serverResponse.message
|
||||
});
|
||||
if (serverResponse.message !== ERROR_NOT_ALLOWED_READ_SECRETS) {
|
||||
createNotification({
|
||||
title: "Error fetching secrets",
|
||||
type: "error",
|
||||
text: serverResponse.message
|
||||
});
|
||||
}
|
||||
|
||||
setIsErrorHandled.on();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user