mirror of
https://github.com/fosrl/pangolin.git
synced 2025-12-14 12:08:11 +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 HttpCode from "@server/types/HttpCode";
|
||||
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 { fromZodError } from "zod-validation-error";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
import { warn } from "console";
|
||||
import { BlueprintData } from "./types";
|
||||
|
||||
const listBluePrintsParamsSchema = z
|
||||
@@ -47,6 +46,7 @@ async function queryBlueprints(orgId: string, limit: number, offset: number) {
|
||||
.from(blueprints)
|
||||
.leftJoin(orgs, eq(blueprints.orgId, orgs.orgId))
|
||||
.where(eq(blueprints.orgId, orgId))
|
||||
.orderBy(desc(blueprints.createdAt))
|
||||
.limit(limit)
|
||||
.offset(offset);
|
||||
return res;
|
||||
|
||||
@@ -198,8 +198,8 @@ export default function BlueprintsTable({ blueprints, orgId }: Props) {
|
||||
}}
|
||||
isRefreshing={isRefreshing}
|
||||
defaultSort={{
|
||||
id: "name",
|
||||
desc: false
|
||||
id: "createdAt",
|
||||
desc: true
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user