1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-03 20:45:23 +02:00
mealie/frontend/src/api/migration.js
Hayden e34079673c
Docs/v0.5.0 second pass (#496)
* update docs

* use auto-gen routes

* dumb deps

* remove whitespace

* github action to build dev docs container

* no cache

Co-authored-by: hay-kot <hay-kot@pm.me>
2021-06-11 21:57:59 -08:00

25 lines
793 B
JavaScript

import { apiReq } from "./api-utils";
import { store } from "../store";
import i18n from "@/i18n.js";
import { API_ROUTES } from "./apiRoutes";
export const migrationAPI = {
async getMigrations() {
let response = await apiReq.get(API_ROUTES.migrations);
return response.data;
},
async delete(folder, file) {
const response = await apiReq.delete(
API_ROUTES.migrationsImportTypeFileNameDelete(folder, file),
null,
() => i18n.t("general.file-folder-not-found"),
() => i18n.t("migration.migration-data-removed")
);
return response;
},
async import(folder, file) {
let response = await apiReq.post(API_ROUTES.migrationsImportTypeFileNameImport(folder, file));
store.dispatch("requestRecentRecipes");
return response.data;
},
};