mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
fix: awaiting in promise.all array
This commit is contained in:
@ -8,7 +8,7 @@ export type GetTemplatesOptions = {
|
|||||||
|
|
||||||
export const getTemplates = async ({ userId, page = 1, perPage = 10 }: GetTemplatesOptions) => {
|
export const getTemplates = async ({ userId, page = 1, perPage = 10 }: GetTemplatesOptions) => {
|
||||||
const [templates, count] = await Promise.all([
|
const [templates, count] = await Promise.all([
|
||||||
await prisma.template.findMany({
|
prisma.template.findMany({
|
||||||
where: {
|
where: {
|
||||||
userId,
|
userId,
|
||||||
},
|
},
|
||||||
@ -21,11 +21,9 @@ export const getTemplates = async ({ userId, page = 1, perPage = 10 }: GetTempla
|
|||||||
createdAt: 'desc',
|
createdAt: 'desc',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
await prisma.template.count({
|
prisma.template.count({
|
||||||
where: {
|
where: {
|
||||||
User: {
|
userId,
|
||||||
id: userId,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user