mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-16 10:03:54 -07:00
Refactor/composables-folder (#787)
* move api clients and rename * organize recipes composables * rewrite useRecipeContext * refactor(frontend): ♻️ abstract common ingredient functionality. * feat(frontend): ✨ add scale, and back to recipe button + hide ingredients if none * update regex to mach 11. instead of just 1. * minor UX improvements Co-authored-by: Hayden K <hay-kot@pm.me>
This commit is contained in:
parent
095d3bda3f
commit
788e176b16
68 changed files with 330 additions and 245 deletions
|
@ -1,13 +1,12 @@
|
|||
import { useAsync, ref } from "@nuxtjs/composition-api";
|
||||
import { CreateEventNotification } from "@/api/class-interfaces/event-notifications";
|
||||
import { useAsyncKey } from "./use-utils";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
import { CreateEventNotification } from "@/api/class-interfaces/event-notifications";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
|
||||
const notificationTypes = ["General", "Discord", "Gotify", "Pushover", "Home Assistant"];
|
||||
|
||||
|
||||
export const useNotifications = function () {
|
||||
const api = useApiSingleton();
|
||||
const api = useUserApi();
|
||||
const loading = ref(false);
|
||||
|
||||
const createNotificationData = ref<CreateEventNotification>({
|
||||
|
@ -23,7 +22,7 @@ export const useNotifications = function () {
|
|||
notificationUrl: "",
|
||||
});
|
||||
|
||||
const deleteTarget = ref(0)
|
||||
const deleteTarget = ref(0);
|
||||
|
||||
function getNotifications() {
|
||||
loading.value = true;
|
||||
|
@ -63,13 +62,13 @@ export const useNotifications = function () {
|
|||
}
|
||||
|
||||
async function testById(id: number) {
|
||||
const {data} = await api.notifications.testNotification(id, null)
|
||||
console.log(data)
|
||||
const { data } = await api.notifications.testNotification(id, null);
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
async function testByUrl(testUrl: string) {
|
||||
const {data} = await api.notifications.testNotification(null, testUrl)
|
||||
console.log(data)
|
||||
const { data } = await api.notifications.testNotification(null, testUrl);
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
const notifications = getNotifications();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue