perf(web, lib): do not await inside promise statements (#692)

This commit is contained in:
Szymon Sus
2023-11-28 23:10:15 +01:00
committed by GitHub
parent adc97802ea
commit 7e4c44e820
2 changed files with 4 additions and 4 deletions

View File

@ -43,11 +43,11 @@ export default async function DocumentPage({ params }: DocumentPageProps) {
const { documentData } = document;
const [recipients, fields] = await Promise.all([
await getRecipientsForDocument({
getRecipientsForDocument({
documentId,
userId: user.id,
}),
await getFieldsForDocument({
getFieldsForDocument({
documentId,
userId: user.id,
}),

View File

@ -32,7 +32,7 @@ export const findUsers = async ({
});
const [users, count] = await Promise.all([
await prisma.user.findMany({
prisma.user.findMany({
include: {
Subscription: true,
Document: {
@ -45,7 +45,7 @@ export const findUsers = async ({
skip: Math.max(page - 1, 0) * perPage,
take: perPage,
}),
await prisma.user.count({
prisma.user.count({
where: whereClause,
}),
]);