-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web): get default locale data from correct place (#6351)
- Loading branch information
1 parent
d44d747
commit 88b6f41
Showing
3 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
Submodule .source
updated
from 9957fe to 366768
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
apps/web/src/ee/translations/hooks/useGetDefaultLocale.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { api } from '../../../api'; | ||
|
||
export const useGetDefaultLocale = () => { | ||
const { data } = useQuery<{ defaultLocale: string }>([`translations/defaultLocale`], () => | ||
api.get(`/v1/translations/defaultLocale`) | ||
); | ||
|
||
return { | ||
defaultLocale: data?.defaultLocale, | ||
}; | ||
}; |