diff options
Diffstat (limited to 'lib/po/service.ts')
| -rw-r--r-- | lib/po/service.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/po/service.ts b/lib/po/service.ts index 5f2e4f35..f62b57fa 100644 --- a/lib/po/service.ts +++ b/lib/po/service.ts @@ -136,6 +136,7 @@ export async function getPOs(input: GetPOSchema) { } const countResult = await countBuilder; + total = countResult[0]?.count || 0; } catch (queryErr) { console.error("Query execution failed:", queryErr); @@ -144,6 +145,9 @@ export async function getPOs(input: GetPOSchema) { const pageCount = Math.ceil(total / input.perPage); + // console.log(data) + // console.log(pageCount) + return { data, pageCount }; } catch (err) { // More detailed error logging |
