1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 05:25:26 +02:00

feat: User Tooltip (#4319)

This commit is contained in:
Michael Genson 2024-10-11 19:36:26 -05:00 committed by GitHub
parent a2bdb02a7f
commit e06572b7ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 164 additions and 80 deletions

View file

@ -6,7 +6,7 @@ import { QueryValue } from "~/lib/api/base/route";
interface ReadOnlyStoreActions<T extends BoundT> {
getAll(page?: number, perPage?: number, params?: any): Ref<T[] | null>;
refresh(): Promise<void>;
refresh(page?: number, perPage?: number, params?: any): Promise<void>;
}
interface StoreActions<T extends BoundT> extends ReadOnlyStoreActions<T> {
@ -50,9 +50,9 @@ export function useReadOnlyActions<T extends BoundT>(
return allItems;
}
async function refresh() {
async function refresh(page = 1, perPage = -1, params = {} as Record<string, QueryValue>) {
loading.value = true;
const { data } = await api.getAll();
const { data } = await api.getAll(page, perPage, params);
if (data && data.items && allRef) {
allRef.value = data.items;
@ -101,9 +101,9 @@ export function useStoreActions<T extends BoundT>(
return allItems;
}
async function refresh() {
async function refresh(page = 1, perPage = -1, params = {} as Record<string, QueryValue>) {
loading.value = true;
const { data } = await api.getAll();
const { data } = await api.getAll(page, perPage, params);
if (data && data.items && allRef) {
allRef.value = data.items;