mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-31 04:05:33 -04:00
Refactor recipe page to use break up the component and make it more usable across different pages. I've left the old route in as well in case there is some functional breaks, I plan to remove it before the official release once we've tested the new editor some more in production. For now there will just have to be some duplicate components and pages around.
26 lines
752 B
TypeScript
26 lines
752 B
TypeScript
import { AxiosResponse } from "axios";
|
|
|
|
export type NoUndefinedField<T> = { [P in keyof T]-?: NoUndefinedField<NonNullable<T[P]>> };
|
|
|
|
export interface RequestResponse<T> {
|
|
response: AxiosResponse<T> | null;
|
|
data: T | null;
|
|
error: any;
|
|
}
|
|
|
|
export interface ApiRequestInstance {
|
|
get<T>(url: string, data?: unknown): Promise<RequestResponse<T>>;
|
|
post<T>(url: string, data: unknown): Promise<RequestResponse<T>>;
|
|
put<T, U = T>(url: string, data: U): Promise<RequestResponse<T>>;
|
|
patch<T, U = Partial<T>>(url: string, data: U): Promise<RequestResponse<T>>;
|
|
delete<T>(url: string): Promise<RequestResponse<T>>;
|
|
}
|
|
|
|
export interface PaginationData<T> {
|
|
page: number;
|
|
per_page: number;
|
|
total: number;
|
|
total_pages: number;
|
|
items: T[];
|
|
}
|