mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 10:05:53 +02:00
fix list resources endpoint and more color tweaks
This commit is contained in:
parent
3eca2ab08e
commit
d677d9c8ea
6 changed files with 170 additions and 90 deletions
|
@ -3,7 +3,7 @@ import { db } from "@server/db";
|
|||
import { orgs, roleSites, sites, userSites } from "@server/db/schema";
|
||||
import HttpCode from "@server/types/HttpCode";
|
||||
import response from "@server/utils/response";
|
||||
import { and, eq, inArray, or, sql } from "drizzle-orm";
|
||||
import { and, count, eq, inArray, or, sql } from "drizzle-orm";
|
||||
import { NextFunction, Request, Response } from "express";
|
||||
import createHttpError from "http-errors";
|
||||
import { z } from "zod";
|
||||
|
@ -123,7 +123,7 @@ export async function listSites(
|
|||
const baseQuery = querySites(orgId, accessibleSiteIds);
|
||||
|
||||
let countQuery = db
|
||||
.select({ count: sql<number>`cast(count(*) as integer)` })
|
||||
.select({ count: count() })
|
||||
.from(sites)
|
||||
.where(
|
||||
and(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue