mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 10:13:32 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			573 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			573 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { BaseCRUDAPI } from "../_base";
 | |
| import { CreateCookBook, RecipeCookBook, UpdateCookBook } from "~/types/api-types/cookbook";
 | |
| 
 | |
| const prefix = "/api";
 | |
| 
 | |
| const routes = {
 | |
|   cookbooks: `${prefix}/groups/cookbooks`,
 | |
|   cookbooksId: (id: number) => `${prefix}/groups/cookbooks/${id}`,
 | |
| };
 | |
| 
 | |
| export class CookbookAPI extends BaseCRUDAPI<CreateCookBook, RecipeCookBook, UpdateCookBook> {
 | |
|   baseRoute: string = routes.cookbooks;
 | |
|   itemRoute = routes.cookbooksId;
 | |
| 
 | |
|   async updateAll(payload: UpdateCookBook[]) {
 | |
|     return await this.requests.put(this.baseRoute, payload);
 | |
|   }
 | |
| }
 |