mirror of
https://github.com/fosrl/pangolin.git
synced 2025-12-16 04:57:52 +00:00
♻️ change default blueprint table ordering to createdAt: desc
This commit is contained in:
@@ -4,11 +4,10 @@ import { db, blueprints, orgs } from "@server/db";
|
|||||||
import response from "@server/lib/response";
|
import response from "@server/lib/response";
|
||||||
import HttpCode from "@server/types/HttpCode";
|
import HttpCode from "@server/types/HttpCode";
|
||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import { sql, eq, or, inArray, and, count } from "drizzle-orm";
|
import { sql, eq, desc } from "drizzle-orm";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromZodError } from "zod-validation-error";
|
import { fromZodError } from "zod-validation-error";
|
||||||
import { OpenAPITags, registry } from "@server/openApi";
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
import { warn } from "console";
|
|
||||||
import { BlueprintData } from "./types";
|
import { BlueprintData } from "./types";
|
||||||
|
|
||||||
const listBluePrintsParamsSchema = z
|
const listBluePrintsParamsSchema = z
|
||||||
@@ -47,6 +46,7 @@ async function queryBlueprints(orgId: string, limit: number, offset: number) {
|
|||||||
.from(blueprints)
|
.from(blueprints)
|
||||||
.leftJoin(orgs, eq(blueprints.orgId, orgs.orgId))
|
.leftJoin(orgs, eq(blueprints.orgId, orgs.orgId))
|
||||||
.where(eq(blueprints.orgId, orgId))
|
.where(eq(blueprints.orgId, orgId))
|
||||||
|
.orderBy(desc(blueprints.createdAt))
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(offset);
|
.offset(offset);
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -198,8 +198,8 @@ export default function BlueprintsTable({ blueprints, orgId }: Props) {
|
|||||||
}}
|
}}
|
||||||
isRefreshing={isRefreshing}
|
isRefreshing={isRefreshing}
|
||||||
defaultSort={{
|
defaultSort={{
|
||||||
id: "name",
|
id: "createdAt",
|
||||||
desc: false
|
desc: true
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user