mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-30 03:38:31 -07:00
Feature/event notifications (#399)
* additional server events * sort 'recent recipes' by updated * remove duplicate code * fixes #396 * set color * consolidate tag/category pages * set colors * list unorganized recipes * cleanup old code * remove flash message, switch to global snackbar * cancel to close * cleanup * notifications first pass * test notification * complete notification feature * use background tasks * add url param * update documentation Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
parent
8923c1ecf8
commit
14b6ab7ec7
49 changed files with 875 additions and 355 deletions
|
@ -1,5 +1,6 @@
|
|||
import { baseURL } from "./api-utils";
|
||||
import { apiReq } from "./api-utils";
|
||||
import i18n from "@/i18n.js";
|
||||
|
||||
const prefix = baseURL + "about";
|
||||
|
||||
|
@ -12,6 +13,10 @@ const aboutURLs = {
|
|||
statistics: `${prefix}/statistics`,
|
||||
events: `${prefix}/events`,
|
||||
event: id => `${prefix}/events/${id}`,
|
||||
|
||||
allNotifications: `${prefix}/events/notifications`,
|
||||
testNotifications: `${prefix}/events/notifications/test`,
|
||||
notification: id => `${prefix}/events/notifications/${id}`,
|
||||
};
|
||||
|
||||
export const aboutAPI = {
|
||||
|
@ -27,6 +32,39 @@ export const aboutAPI = {
|
|||
const resposne = await apiReq.delete(aboutURLs.events);
|
||||
return resposne.data;
|
||||
},
|
||||
|
||||
async allEventNotifications() {
|
||||
const response = await apiReq.get(aboutURLs.allNotifications);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async createNotification(data) {
|
||||
const response = await apiReq.post(aboutURLs.allNotifications, data);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async deleteNotification(id) {
|
||||
const response = await apiReq.delete(aboutURLs.notification(id));
|
||||
return response.data;
|
||||
},
|
||||
async testNotificationByID(id) {
|
||||
const response = await apiReq.post(
|
||||
aboutURLs.testNotifications,
|
||||
{ id: id },
|
||||
() => i18n.t("events.something-went-wrong"),
|
||||
() => i18n.t("events.test-message-sent")
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
async testNotificationByURL(url) {
|
||||
const response = await apiReq.post(
|
||||
aboutURLs.testNotifications,
|
||||
{ test_url: url },
|
||||
() => i18n.t("events.something-went-wrong"),
|
||||
() => i18n.t("events.test-message-sent")
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
// async getAppInfo() {
|
||||
// const response = await apiReq.get(aboutURLs.version);
|
||||
// return response.data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue