hassio-nextcloud-backup/nextcloud_backup/frontend/src/services/messageService.ts

14 lines
390 B
TypeScript
Raw Normal View History

import type { Message } from "@/types/messages";
import kyClient from "./kyClient";
export function getMessages() {
return kyClient.get("messages").json<Message[]>();
}
2022-10-26 14:09:10 +02:00
export function markRead(id: string) {
return kyClient.patch(`messages/${encodeURI(id)}/readed`).json<Message[]>();
}
2024-02-19 10:52:37 +01:00
export function markAllRead(){
return kyClient.post(`messages/allReaded`).json<Message[]>();
}