mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
perf(web, lib): do not await inside promise statements (#692)
This commit is contained in:
@ -43,11 +43,11 @@ export default async function DocumentPage({ params }: DocumentPageProps) {
|
|||||||
const { documentData } = document;
|
const { documentData } = document;
|
||||||
|
|
||||||
const [recipients, fields] = await Promise.all([
|
const [recipients, fields] = await Promise.all([
|
||||||
await getRecipientsForDocument({
|
getRecipientsForDocument({
|
||||||
documentId,
|
documentId,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
}),
|
}),
|
||||||
await getFieldsForDocument({
|
getFieldsForDocument({
|
||||||
documentId,
|
documentId,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export const findUsers = async ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [users, count] = await Promise.all([
|
const [users, count] = await Promise.all([
|
||||||
await prisma.user.findMany({
|
prisma.user.findMany({
|
||||||
include: {
|
include: {
|
||||||
Subscription: true,
|
Subscription: true,
|
||||||
Document: {
|
Document: {
|
||||||
@ -45,7 +45,7 @@ export const findUsers = async ({
|
|||||||
skip: Math.max(page - 1, 0) * perPage,
|
skip: Math.max(page - 1, 0) * perPage,
|
||||||
take: perPage,
|
take: perPage,
|
||||||
}),
|
}),
|
||||||
await prisma.user.count({
|
prisma.user.count({
|
||||||
where: whereClause,
|
where: whereClause,
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user