feat: add reviews, notifications, notes and account hardening
All checks were successful
CI / Validate frontend and API (push) Successful in 59s
CI / Build and publish Docker images (push) Successful in 23s

This commit is contained in:
Cauê Faleiros
2026-11-05 17:27:36 -03:00
parent 21085e887d
commit fff63f5efa
32 changed files with 1109 additions and 84 deletions

29
services/notifications.ts Normal file
View File

@@ -0,0 +1,29 @@
import { apiRequest } from './api';
export type NotificationItem = {
id: string;
kind: string;
title: string;
body: string;
href: string;
readAt: string | null;
createdAt: string;
};
export type NotificationFeed = {
items: NotificationItem[];
unread: number;
};
export const getNotifications = async (): Promise<NotificationFeed> => {
const response = await apiRequest<{ data: NotificationFeed }>('/notifications');
return response.data;
};
export const markNotificationRead = async (notificationId: string): Promise<void> => {
await apiRequest<void>(`/notifications/${notificationId}/read`, { method: 'POST' });
};
export const markAllNotificationsRead = async (): Promise<void> => {
await apiRequest<void>('/notifications/read-all', { method: 'POST' });
};