mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
documentation
This commit is contained in:
parent
db8ac250cd
commit
c51b209dc4
2 changed files with 31 additions and 5 deletions
|
@ -14,25 +14,46 @@ const backupURLs = {
|
|||
};
|
||||
|
||||
export default {
|
||||
/**
|
||||
* Request all backups available on the server
|
||||
* @returns {Array} List of Available Backups
|
||||
*/
|
||||
async requestAvailable() {
|
||||
let response = await apiReq.get(backupURLs.available);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Calls for importing a file on the server
|
||||
* @param {string} fileName
|
||||
* @param {object} data
|
||||
* @returns A report containing status of imported items
|
||||
*/
|
||||
async import(fileName, data) {
|
||||
let response = await apiReq.post(backupURLs.importBackup(fileName), data);
|
||||
store.dispatch("requestRecentRecipes");
|
||||
return response;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes a file from the server
|
||||
* @param {string} fileName
|
||||
*/
|
||||
async delete(fileName) {
|
||||
await apiReq.delete(backupURLs.deleteBackup(fileName));
|
||||
},
|
||||
|
||||
async create(data) {
|
||||
let response = apiReq.post(backupURLs.createBackup, data);
|
||||
/**
|
||||
* Creates a backup on the serve given a set of options
|
||||
* @param {object} data
|
||||
* @returns
|
||||
*/
|
||||
async create(options) {
|
||||
let response = apiReq.post(backupURLs.createBackup, options);
|
||||
return response;
|
||||
},
|
||||
/**
|
||||
* Downloads a file from the server. I don't actually think this is used?
|
||||
* @param {string} fileName
|
||||
* @returns Download URL
|
||||
*/
|
||||
async download(fileName) {
|
||||
let response = await apiReq.get(backupURLs.downloadBackup(fileName));
|
||||
return response.data;
|
||||
|
|
|
@ -19,6 +19,11 @@ const recipeURLs = {
|
|||
};
|
||||
|
||||
export default {
|
||||
/**
|
||||
* Create a Recipe by URL
|
||||
* @param {String} recipeURL
|
||||
* @returns {String} Recipe Slug
|
||||
*/
|
||||
async createByURL(recipeURL) {
|
||||
let response = await apiReq.post(recipeURLs.createByURL, {
|
||||
url: recipeURL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue