mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-12 08:07:14 -07:00
feat: Filter Recipes By Household (and a ton of bug fixes) (#4207)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
2a6922a85c
commit
7c274de778
65 changed files with 896 additions and 590 deletions
|
@ -1,6 +1,5 @@
|
|||
import { BaseCRUDAPI } from "../base/base-clients";
|
||||
import { GroupBase, GroupInDB, GroupSummary, UserSummary } from "~/lib/api/types/user";
|
||||
import { HouseholdSummary } from "~/lib/api/types/household";
|
||||
import {
|
||||
GroupAdminUpdate,
|
||||
GroupStorage,
|
||||
|
@ -15,8 +14,6 @@ const routes = {
|
|||
groupsSelf: `${prefix}/groups/self`,
|
||||
preferences: `${prefix}/groups/preferences`,
|
||||
storage: `${prefix}/groups/storage`,
|
||||
households: `${prefix}/groups/households`,
|
||||
householdsId: (id: string | number) => `${prefix}/groups/households/${id}`,
|
||||
membersHouseholdId: (householdId: string | number | null) => {
|
||||
return householdId ?
|
||||
`${prefix}/households/members?householdId=${householdId}` :
|
||||
|
@ -47,14 +44,6 @@ export class GroupAPI extends BaseCRUDAPI<GroupBase, GroupInDB, GroupAdminUpdate
|
|||
return await this.requests.get<UserSummary[]>(routes.membersHouseholdId(householdId));
|
||||
}
|
||||
|
||||
async fetchHouseholds() {
|
||||
return await this.requests.get<HouseholdSummary[]>(routes.households);
|
||||
}
|
||||
|
||||
async fetchHousehold(householdId: string | number) {
|
||||
return await this.requests.get<HouseholdSummary>(routes.householdsId(householdId));
|
||||
}
|
||||
|
||||
async storage() {
|
||||
return await this.requests.get<GroupStorage>(routes.storage);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue