Merge remote-tracking branch 'chamomind/feat/20250709' into develop
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
This commit is contained in:
commit
36c9c25f61
2 changed files with 6 additions and 3 deletions
|
|
@ -70,8 +70,9 @@ const permissionCheckCompany = createPermCheck((_) => true);
|
|||
@Tags("Task Order")
|
||||
export class TaskController extends Controller {
|
||||
@Get("stats")
|
||||
async getTaskOrderStats() {
|
||||
async getTaskOrderStats(@Request() req: RequestWithUser) {
|
||||
const task = await prisma.taskOrder.groupBy({
|
||||
where: { registeredBranch: { OR: permissionCondCompany(req.user) } },
|
||||
by: ["taskOrderStatus"],
|
||||
_count: true,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ export class businessTypeController extends Controller {
|
|||
const [result, total] = await prisma.$transaction([
|
||||
prisma.businessType.findMany({
|
||||
where,
|
||||
take: pageSize,
|
||||
skip: (page - 1) * pageSize,
|
||||
}),
|
||||
prisma.businessType.count({ where }),
|
||||
]);
|
||||
|
|
@ -84,7 +86,7 @@ export class businessTypeController extends Controller {
|
|||
});
|
||||
|
||||
if (!record) throw notFoundError("BusinessType");
|
||||
return await prisma.businessType.update({
|
||||
return await tx.businessType.update({
|
||||
where: { id: businessTypeId },
|
||||
data: {
|
||||
...body,
|
||||
|
|
@ -103,7 +105,7 @@ export class businessTypeController extends Controller {
|
|||
});
|
||||
|
||||
if (!record) throw notFoundError("BusinessType");
|
||||
return await prisma.businessType.delete({
|
||||
return await tx.businessType.delete({
|
||||
where: { id: businessTypeId },
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue