fest: add page
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:
parent
c2195d4448
commit
1f63089363
1 changed files with 4 additions and 2 deletions
|
|
@ -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