mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 15:49:42 +02:00
Feature/shareable recipes (#866)
* simplify context menu * move computed to comp-api * feat: ✨ create share tokens for recipes for sharing recieps to non-users * feat: ✨ shareable recipe links with og tags
This commit is contained in:
parent
ba4107348f
commit
b2673d75bf
25 changed files with 914 additions and 199 deletions
26
frontend/api/class-interfaces/recipes/recipe-share.ts
Normal file
26
frontend/api/class-interfaces/recipes/recipe-share.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { BaseCRUDAPI } from "~/api/_base";
|
||||
|
||||
const prefix = "/api";
|
||||
|
||||
const routes = {
|
||||
shareToken: `${prefix}/shared/recipes`,
|
||||
shareTokenId: (id: string) => `${prefix}/shared/recipes/${id}`,
|
||||
};
|
||||
|
||||
export interface RecipeShareTokenCreate {
|
||||
recipeId: number;
|
||||
expiresAt?: Date;
|
||||
}
|
||||
|
||||
export interface RecipeShareToken {
|
||||
recipeId: number;
|
||||
id: string;
|
||||
groupId: number;
|
||||
expiresAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export class RecipeShareApi extends BaseCRUDAPI<RecipeShareToken, RecipeShareTokenCreate> {
|
||||
baseRoute: string = routes.shareToken;
|
||||
itemRoute = routes.shareTokenId;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue