1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-02 20:15:24 +02:00

feat: Add Households to Mealie (#3970)

This commit is contained in:
Michael Genson 2024-08-22 10:14:32 -05:00 committed by GitHub
parent 0c29cef17d
commit eb170cc7e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
315 changed files with 6975 additions and 3577 deletions

View file

@ -24,17 +24,18 @@ export default defineComponent({
const groupName = ref<string>("");
const queryFilter = ref<string>("");
async function fetchGroup() {
const { data } = await api.groups.getCurrentUserGroup();
async function fetchHousehold() {
const { data } = await api.households.getCurrentUserHousehold();
if (data) {
queryFilter.value = `recipe.group_id="${data.id}"`;
groupName.value = data.name;
// TODO: once users are able to fetch other households' recipes, remove the household filter
queryFilter.value = `recipe.group_id="${data.groupId}" AND recipe.household_id="${data.id}"`;
groupName.value = data.group;
}
ready.value = true;
}
fetchGroup();
fetchHousehold();
return {
groupName,
queryFilter,