feat: add searchByAddress route
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
getPermit,
|
||||
listPermits,
|
||||
searchPermit,
|
||||
searchPermitByAddress,
|
||||
updatePermit,
|
||||
} from "./permit.service";
|
||||
import { PageQueryParams } from "../pagination";
|
||||
@@ -102,3 +103,17 @@ export async function searchPermitHandler(
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
export async function searchPermitByAddressHandler(
|
||||
req: FastifyRequest,
|
||||
res: FastifyReply
|
||||
) {
|
||||
const { address } = req.body as { address: string };
|
||||
|
||||
try {
|
||||
const permitList = await searchPermitByAddress(address);
|
||||
return res.code(200).send(permitList);
|
||||
} catch (err) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user