add random to display
All checks were successful
backend-action / build-image (push) Successful in 26s

This commit is contained in:
2024-05-13 13:56:44 +07:00
parent 1d834f3a51
commit 6129f489dd

View File

@@ -10,7 +10,7 @@ import {
} from "./schema"; } from "./schema";
import { createInsertSchema } from "drizzle-zod"; import { createInsertSchema } from "drizzle-zod";
import { z } from "zod"; import { z } from "zod";
import { SQL, and, count, eq, inArray } from "drizzle-orm"; import { SQL, and, count, eq, inArray, sql } from "drizzle-orm";
import { Config } from "./config"; import { Config } from "./config";
import { TRPCError } from "@trpc/server"; import { TRPCError } from "@trpc/server";
import * as jwt from "jsonwebtoken"; import * as jwt from "jsonwebtoken";
@@ -170,6 +170,7 @@ async function getAllUser(
}, },
limit, limit,
offset, offset,
orderBy: sql`random()`,
where: (user, { eq, and }) => { where: (user, { eq, and }) => {
let conditions: SQL[] = []; let conditions: SQL[] = [];
if (group !== undefined) { if (group !== undefined) {