mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-04 01:36:39 +00:00
fix count in list domains endpoint
This commit is contained in:
@@ -80,15 +80,15 @@ export async function listDomains(
|
|||||||
|
|
||||||
const { orgId } = parsedParams.data;
|
const { orgId } = parsedParams.data;
|
||||||
|
|
||||||
const domains = await queryDomains(orgId.toString(), limit, offset);
|
const domainsList = await queryDomains(orgId.toString(), limit, offset);
|
||||||
|
|
||||||
const [{ count }] = await db
|
const [{ count }] = await db
|
||||||
.select({ count: sql<number>`count(*)` })
|
.select({ count: sql<number>`count(*)` })
|
||||||
.from(users);
|
.from(domains);
|
||||||
|
|
||||||
return response<ListDomainsResponse>(res, {
|
return response<ListDomainsResponse>(res, {
|
||||||
data: {
|
data: {
|
||||||
domains,
|
domains: domainsList,
|
||||||
pagination: {
|
pagination: {
|
||||||
total: count,
|
total: count,
|
||||||
limit,
|
limit,
|
||||||
|
|||||||
Reference in New Issue
Block a user