basic category chaning

This commit is contained in:
vabene1111
2023-12-23 11:11:36 +01:00
parent ae3818611d
commit b0c561661b
4 changed files with 45 additions and 24 deletions

View File

@@ -12,8 +12,9 @@ const _LOCAL_STORAGE_KEY = "SHOPPING_LIST_CLIENT_SETTINGS"
export const useShoppingListStore = defineStore(_STORE_ID, {
state: () => ({
category_food_entries: {},
supermarket_categories: [],
show_checked_entries: false,
show_checked_entries: false, // TODO move to settings
currently_updating: false,
settings: null,
@@ -43,6 +44,14 @@ export const useShoppingListStore = defineStore(_STORE_ID, {
this.updateEntryInStructure(e)
})
this.currently_updating = false
}).catch((err) => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
apiClient.listSupermarketCategorys().then(r => {
this.supermarket_categories = r.data
}).catch((err) => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
}
},