fix: temp fix for snippet pagination

This commit is contained in:
Florian Sylvain
2024-10-16 13:55:11 +02:00
parent e73c860437
commit 475404c1ce
+4 -3
View File
@@ -45,7 +45,8 @@ async function findSnippets(userId: number, pagination: Pagination): Promise<Sni
select: { tag: { select: { id: true, name: true } } }, select: { tag: { select: { id: true, name: true } } },
}, },
}, },
...pagination, skip: pagination.skip,
take: pagination.take,
}) })
} }
@@ -124,7 +125,7 @@ async function updateSnippet(
snippetId: number, snippetId: number,
userId: number, userId: number,
languageId: number | undefined, languageId: number | undefined,
snippetData: any snippetData: any,
): Promise<Prisma.BatchPayload> { ): Promise<Prisma.BatchPayload> {
return await prisma.snippet.updateMany({ return await prisma.snippet.updateMany({
where: { where: {
@@ -143,7 +144,7 @@ async function updateSnippet(
async function updateTagsFromSnippet( async function updateTagsFromSnippet(
snippetId: number, snippetId: number,
userId: number, userId: number,
snippetData: any snippetData: any,
): Promise<void> { ): Promise<void> {
if (snippetData.tags == undefined) return if (snippetData.tags == undefined) return