(name: string)
| 22 | }; |
| 23 | |
| 24 | const createAuthKey = async (name: string): Promise<string | null> => { |
| 25 | try { |
| 26 | setError(null); |
| 27 | const newKey = await authKeyService.createAuthKey(name); |
| 28 | // Refresh the list after creating a new key |
| 29 | await fetchAuthKeys(); |
| 30 | return newKey; |
| 31 | } catch (err) { |
| 32 | const errorMessage = |
| 33 | err instanceof Error ? err.message : "Failed to create auth key"; |
| 34 | setError(errorMessage); |
| 35 | return null; |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | useEffect(() => { |
| 40 | fetchAuthKeys(); |
no test coverage detected