add search to task
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user