mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 22:43:34 -07:00
make useREquests a bit easier to read
This commit is contained in:
parent
9523b1fec6
commit
26a2bd1bf1
1 changed files with 2 additions and 3 deletions
|
@ -54,13 +54,12 @@ function getRequests(axiosInstance: AxiosInstance): ApiRequestInstance {
|
|||
}
|
||||
|
||||
export const useRequests = function (i18n?: Composer): ApiRequestInstance {
|
||||
const { $axios } = useNuxtApp();
|
||||
if (!i18n) {
|
||||
// Note: this only works in setup()
|
||||
// Only works in a setup block
|
||||
i18n = useI18n();
|
||||
}
|
||||
|
||||
const { $axios } = useNuxtApp();
|
||||
|
||||
$axios.defaults.headers.common["Accept-Language"] = i18n.locale.value;
|
||||
|
||||
return getRequests($axios);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue