frontend added and socket io
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { logs } from "backend/db/schema/logs.schema.js";
|
||||
import { desc } from "drizzle-orm";
|
||||
import { db } from "../db/db.controller.js";
|
||||
import { logs } from "../db/schema/logs.schema.js";
|
||||
import type { RoomId } from "./types.socket.js";
|
||||
|
||||
type RoomDefinition<T = unknown> = {
|
||||
@@ -14,10 +13,10 @@ export const roomDefinition: Record<RoomId, RoomDefinition> = {
|
||||
const rows = await db
|
||||
.select()
|
||||
.from(logs)
|
||||
.orderBy(desc(logs.createdAt))
|
||||
.orderBy(logs.createdAt)
|
||||
.limit(limit);
|
||||
|
||||
return rows.reverse();
|
||||
return rows; //.reverse();
|
||||
} catch (e) {
|
||||
console.error("Failed to seed logs:", e);
|
||||
return [];
|
||||
@@ -27,6 +26,7 @@ export const roomDefinition: Record<RoomId, RoomDefinition> = {
|
||||
|
||||
labels: {
|
||||
seed: async (limit) => {
|
||||
console.info(limit);
|
||||
return [];
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user