UNPKG

@opengis/admin

Version:

This project Softpro Admin

27 lines (19 loc) 1.21 kB
import { addHook } from '@opengis/fastify-table/utils.js'; // api import testEmail from './controllers/testEmail.js'; import readNotifications from './controllers/readNotifications.js'; // mark as read import userNotifications from './controllers/userNotifications.js'; // check all, backend pagination // hook import onWidgetSet from './hook/onWidgetSet.js'; // send notification on comment // funcs // import addNotification from '../notifications/funcs/addNotification.js'; // add to db // import notification from '../notifications/funcs/sendNotification.js'; // send notification import { notificationSchema, emailSchema } from './schema.js'; export default async function route(fastify) { // fastify.decorate('addNotification', addNotification); // fastify.decorate('notification', notification); fastify.get('/test-email', { config: { policy: ['user'] }, schema: emailSchema }, testEmail); fastify.get('/notification', { config: { policy: ['user'] }, schema: notificationSchema }, userNotifications); fastify.get('/notification-read/:id?', { config: { policy: ['user'] }, schema: notificationSchema }, readNotifications); addHook('onWidgetSet', onWidgetSet); }