Route corrected

This commit is contained in:
AmitChauhan63390
2024-11-15 22:26:36 +05:30
parent 8eedca1b1e
commit 8d4994c8c7
4 changed files with 93 additions and 32 deletions

View File

@@ -38,6 +38,8 @@ const ApiKeyManager = () => {
useEffect(() => {
const fetchApiKey = async () => {
try {
@@ -51,6 +53,7 @@ const ApiKeyManager = () => {
};
fetchApiKey();
}, []);
const generateApiKey = async () => {
@@ -58,7 +61,7 @@ const ApiKeyManager = () => {
try {
const { data } = await axios.post(`${apiUrl}/auth/generate-api-key`);
setApiKey(data.api_key);
localStorage.setItem('x-api-key', data.api_key);
notify('success', `Generated API Key successfully`);
} catch (error: any) {
notify('error', `Failed to generate API Key - ${error.message}`);