add search to task

This commit is contained in:
2025-02-11 14:51:03 +05:30
parent 6ae05cfe6b
commit 2952496f5c
3 changed files with 115 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import {
deleteTaskHandler,
getTaskHandler,
listTaskHandler,
searchTaskHandler,
updateTaskHandler,
} from "./task.controller";
import { noteRoutes } from "../note/note.route";
@@ -81,6 +82,18 @@ export async function taskRoutes(fastify: FastifyInstance) {
deleteTaskHandler
);
fastify.get(
"/search",
{
schema: {
querystring: $task("pageQueryParams"),
},
config: { requiredClaims: ["task:read"] },
preHandler: [fastify.authorize],
},
searchTaskHandler
);
await noteRoutes(fastify, {
read: "task:read",
write: "task:write",