summaryrefslogtreecommitdiff
path: root/lib/po/service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/po/service.ts')
-rw-r--r--lib/po/service.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/po/service.ts b/lib/po/service.ts
index f697bd58..a6c53d9c 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