mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 02:03:35 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			913 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			913 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { BaseCRUDAPI } from "../base/base-clients";
 | |
| import type { CreateGroupRecipeAction, GroupRecipeActionOut } from "~/lib/api/types/household";
 | |
| 
 | |
| const prefix = "/api";
 | |
| 
 | |
| const routes = {
 | |
|   groupRecipeActions: `${prefix}/households/recipe-actions`,
 | |
|   groupRecipeActionsId: (id: string | number) => `${prefix}/households/recipe-actions/${id}`,
 | |
|   groupRecipeActionsIdTriggerRecipeSlug: (id: string | number, recipeSlug: string) => `${prefix}/households/recipe-actions/${id}/trigger/${recipeSlug}`,
 | |
| };
 | |
| 
 | |
| export class GroupRecipeActionsAPI extends BaseCRUDAPI<CreateGroupRecipeAction, GroupRecipeActionOut> {
 | |
|   baseRoute = routes.groupRecipeActions;
 | |
|   itemRoute = routes.groupRecipeActionsId;
 | |
| 
 | |
|   async triggerAction(id: string | number, recipeSlug: string, recipeScale: number) {
 | |
|     return await this.requests.post(routes.groupRecipeActionsIdTriggerRecipeSlug(id, recipeSlug), { recipe_scale: recipeScale });
 | |
|   }
 | |
| }
 |