update role claims, refactor getUniqueValues
This commit is contained in:
@@ -2,12 +2,12 @@ import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
|
||||
import { PageQueryParams } from "../pagination";
|
||||
import {
|
||||
getProcessedPermit,
|
||||
getUniqueValuesProcessed,
|
||||
listProcessedPermits,
|
||||
updateProcessed,
|
||||
} from "./processed.service";
|
||||
import { $processed, UpdateProcessedInput } from "./processed.schema";
|
||||
import { noteRoutes } from "../note/note.route";
|
||||
import { getUniqueFields } from "../unique";
|
||||
|
||||
export async function processedRoutes(fastify: FastifyInstance) {
|
||||
fastify.get(
|
||||
@@ -120,9 +120,10 @@ export async function processedRoutes(fastify: FastifyInstance) {
|
||||
const { field } = req.params as { field: string };
|
||||
|
||||
try {
|
||||
const uniqueValues = await getUniqueValuesProcessed(
|
||||
const uniqueValues = await getUniqueFields(
|
||||
field,
|
||||
req.user.tenantId
|
||||
"processed",
|
||||
req.user
|
||||
);
|
||||
return res.code(200).send(uniqueValues);
|
||||
} catch (err) {
|
||||
@@ -131,9 +132,5 @@ export async function processedRoutes(fastify: FastifyInstance) {
|
||||
}
|
||||
);
|
||||
|
||||
await noteRoutes(fastify, {
|
||||
read: "permit:read",
|
||||
write: "permit:write",
|
||||
delete: "permit:delete",
|
||||
});
|
||||
await noteRoutes(fastify);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user