修复授权分页并补齐追回到账诊断验证(09-17-company-loan-principal-repayment)
这个提交包含在:
@@ -239,8 +239,11 @@ async function companyLoansRoutes(fastify) {
|
||||
});
|
||||
fastify.get("/loan-lenders", auth, async (request, reply) => {
|
||||
ensureLoanManager(fastify, request);
|
||||
const query = parse(LIST.omit({ lenderId: true }), request.query ?? {});
|
||||
const where = { archived_at: null };
|
||||
const query = parse(LIST.omit({ lenderId: true }).extend({ eligible: z.enum(["related_authority"]).optional() }).strict(), request.query ?? {});
|
||||
// The authorization dialog pages only lenders it can offer, so no page is
|
||||
// empty after client-side filtering.
|
||||
const where = { archived_at: null, ...(query.eligible === "related_authority"
|
||||
? { identity_status: "verified", employee_id: { not: null }, NOT: { employee_id: request.employee.id } } : {}) };
|
||||
const [items, total] = await Promise.all([
|
||||
fastify.prisma.loanLender.findMany({ where, include: LENDER_INCLUDE, orderBy: [{ name: "asc" }, { id: "asc" }],
|
||||
skip: (query.page - 1) * query.pageSize, take: query.pageSize }),
|
||||
|
||||
在新工单中引用
屏蔽一个用户