mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-21 22:31:46 +00:00
Merge branch 'review/pr-542' into feat/search-autocomplete
This commit is contained in:
@@ -194,6 +194,7 @@ export const useAuthStore = create<AuthState>()(
|
||||
await authApi.updateMapsKey(key)
|
||||
set((state) => ({
|
||||
user: state.user ? { ...state.user, maps_api_key: key || null } : null,
|
||||
hasMapsKey: !!key,
|
||||
}))
|
||||
} catch (err: unknown) {
|
||||
throw new Error(getApiErrorMessage(err, 'Error saving API key'))
|
||||
@@ -204,6 +205,9 @@ export const useAuthStore = create<AuthState>()(
|
||||
try {
|
||||
const data = await authApi.updateApiKeys(keys)
|
||||
set({ user: data.user })
|
||||
if ('maps_api_key' in keys) {
|
||||
set({ hasMapsKey: !!keys.maps_api_key })
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
throw new Error(getApiErrorMessage(err, 'Error saving API keys'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user