diff --git a/vue3/src/apps/tandoor/Tandoor.vue b/vue3/src/apps/tandoor/Tandoor.vue index e31ff75a9a..1b36b005ff 100644 --- a/vue3/src/apps/tandoor/Tandoor.vue +++ b/vue3/src/apps/tandoor/Tandoor.vue @@ -42,11 +42,18 @@ - - Spaces - Space 1 - Space 2 - Space 3 + + + {{ $t('YourSpaces')}} + + + + + + {{ s.name}} + + + @@ -151,11 +158,26 @@ import {useUserPreferenceStore} from "@/stores/UserPreferenceStore"; import {TAutomation, TCookLog, TFood, TKeyword, TPropertyType, TSupermarket, TSupermarketCategory, TUnit, TUnitConversion, TUserFile, TViewLog} from "@/types/Models"; import NavigationDrawerContextMenu from "@/components/display/NavigationDrawerContextMenu.vue"; import {useDjangoUrls} from "@/composables/useDjangoUrls"; +import {onMounted, ref} from "vue"; +import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore"; +import {ApiApi, Space} from "@/openapi"; const {lgAndUp} = useDisplay() const {getDjangoUrl} = useDjangoUrls() -useUserPreferenceStore() +const spaces = ref([] as Space[]) + +onMounted(() => { + let api = new ApiApi() + + useUserPreferenceStore() + + api.apiSpaceList().then(r => { + spaces.value = r.results + }).catch(err => { + useMessageStore().addError(ErrorMessageType.FETCH_ERROR, err) + }) +}) diff --git a/vue3/src/components/settings/UserSpaceSettings.vue b/vue3/src/components/settings/UserSpaceSettings.vue index c29da53add..6634993ab1 100644 --- a/vue3/src/components/settings/UserSpaceSettings.vue +++ b/vue3/src/components/settings/UserSpaceSettings.vue @@ -2,13 +2,16 @@ - {{ $t('YourSpaces') }} + + {{ $t('YourSpaces') }} + {{$t('New')}} + - + {{ s.name }} @@ -28,6 +31,9 @@ import {ApiApi, Space} from "@/openapi"; import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore"; import recipeDefaultImage from '../../assets/recipe_no_image.svg' import {useUserPreferenceStore} from "@/stores/UserPreferenceStore"; +import {useDjangoUrls} from "@/composables/useDjangoUrls"; + +const {getDjangoUrl} = useDjangoUrls() const spaces = ref([] as Space[]) diff --git a/vue3/src/stores/UserPreferenceStore.ts b/vue3/src/stores/UserPreferenceStore.ts index 437b639fc4..beb85139db 100644 --- a/vue3/src/stores/UserPreferenceStore.ts +++ b/vue3/src/stores/UserPreferenceStore.ts @@ -109,6 +109,7 @@ export const useUserPreferenceStore = defineStore('user_preference_store', () => api.apiSwitchActiveSpaceRetrieve({spaceId: space.id}).then(r => { loadActiveSpace() + location.reload() }).catch(err => { useMessageStore().addError(ErrorMessageType.FETCH_ERROR, err) })
{{ $t('YourSpaces') }}
+ {{ $t('YourSpaces') }} + {{$t('New')}} +