mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-12 08:07:14 -07: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:
parent
5cfff75dbe
commit
7adcc86d03
10 changed files with 168 additions and 66 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue