mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-30 17:53:31 -04:00 
			
		
		
		
	feat: bulk recipe settings update (#1557)
* extract switches from menu component * implement bulk updater for settings * fix browser cache api calls issue * add frontend for bulk settings modifications
This commit is contained in:
		| @@ -1,11 +1,10 @@ | ||||
| import { BaseAPI } from "../_base"; | ||||
| import { AssignCategories, AssignTags, DeleteRecipes, ExportRecipes } from "~/types/api-types/recipe"; | ||||
| import { AssignCategories, AssignSettings, AssignTags, DeleteRecipes, ExportRecipes } from "~/types/api-types/recipe"; | ||||
| import { GroupDataExport } from "~/types/api-types/group"; | ||||
|  | ||||
| // Many bulk actions return nothing | ||||
| // eslint-disable-next-line @typescript-eslint/no-empty-interface | ||||
| interface BulkActionResponse { | ||||
| } | ||||
| interface BulkActionResponse {} | ||||
|  | ||||
| const prefix = "/api"; | ||||
|  | ||||
| @@ -15,6 +14,7 @@ const routes = { | ||||
|   bulkCategorize: prefix + "/recipes/bulk-actions/categorize", | ||||
|   bulkTag: prefix + "/recipes/bulk-actions/tag", | ||||
|   bulkDelete: prefix + "/recipes/bulk-actions/delete", | ||||
|   bulkSettings: prefix + "/recipes/bulk-actions/settings", | ||||
| }; | ||||
|  | ||||
| export class BulkActionsAPI extends BaseAPI { | ||||
| @@ -26,6 +26,10 @@ export class BulkActionsAPI extends BaseAPI { | ||||
|     return await this.requests.post<BulkActionResponse>(routes.bulkCategorize, payload); | ||||
|   } | ||||
|  | ||||
|   async bulkSetSettings(payload: AssignSettings) { | ||||
|     return await this.requests.post<BulkActionResponse>(routes.bulkSettings, payload); | ||||
|   } | ||||
|  | ||||
|   async bulkTag(payload: AssignTags) { | ||||
|     return await this.requests.post<BulkActionResponse>(routes.bulkTag, payload); | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user