mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-01 10:43:25 -04:00
Consolidate frontend types (#1245)
This commit is contained in:
committed by
GitHub
parent
6a88a59981
commit
479900e912
@@ -1,4 +1,5 @@
|
||||
import { BaseCRUDAPI } from "~/api/_base";
|
||||
import { RecipeShareToken, RecipeShareTokenCreate } from "~/types/api-types/recipe";
|
||||
|
||||
const prefix = "/api";
|
||||
|
||||
@@ -7,20 +8,7 @@ const routes = {
|
||||
shareTokenId: (id: string) => `${prefix}/shared/recipes/${id}`,
|
||||
};
|
||||
|
||||
export interface RecipeShareTokenCreate {
|
||||
recipeId: string;
|
||||
expiresAt?: Date;
|
||||
}
|
||||
|
||||
export interface RecipeShareToken {
|
||||
recipeId: string;
|
||||
id: string;
|
||||
groupId: number;
|
||||
expiresAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export class RecipeShareApi extends BaseCRUDAPI<RecipeShareToken, RecipeShareTokenCreate> {
|
||||
export class RecipeShareApi extends BaseCRUDAPI<RecipeShareTokenCreate, RecipeShareToken> {
|
||||
baseRoute: string = routes.shareToken;
|
||||
itemRoute = routes.shareTokenId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user