Route corrected
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user