ethan!
ethan!
Explore posts from servers
VVALORANT
Created by ethan! on 7/6/2024 in #community-help
No team VC
I have no team VC, any ideas?
1 replies
NNuxt
Created by ethan! on 6/28/2024 in #❓・help
API route called multiple times
I have a page which calls an API route once:
const { data: guilds } = useFetch("/api/discord/guilds");
const { data: guilds } = useFetch("/api/discord/guilds");
However on the server side it's logging as three separate requests. This is bad because in my server I'm calling an external API and it's getting me ratelimited. Any ideas how to only call my API once?
15 replies
NNuxt
Created by ethan! on 6/25/2024 in #❓・help
Buffer is not defined
Buffer is not defined

at http://localhost:3000/_nuxt/@fs/C:/Users/ethan/Desktop/Projects/watchdog/website/node_modules/.cache/vite/client/deps/postgres.js?v=9ecbf21c:617:14
Buffer is not defined

at http://localhost:3000/_nuxt/@fs/C:/Users/ethan/Desktop/Projects/watchdog/website/node_modules/.cache/vite/client/deps/postgres.js?v=9ecbf21c:617:14
20 replies
NNuxt
Created by ethan! on 6/23/2024 in #❓・help
Pages directory
If i want to create a page specific component do i have to use the components folder? like there's no way to create the component in the pages directory with the page itself
19 replies
NNuxt
Created by ethan! on 6/23/2024 in #❓・help
eslint file not checking itself
How do I make my eslint.config.mjs file check for eslint erorrs in its own file?
1 replies
DTDrizzle Team
Created by ethan! on 5/27/2024 in #help
Enums
const validStatuses = ["claimed", "confirmed", "started"] as const;
const statusEnum = pgEnum("status", validStatuses);
export type SessionStatus = typeof validStatuses[number];

export const trainingsTable = pgTable("training", {
date: text("date").primaryKey(),
host: text("host").notNull(),
status: statusEnum("status").notNull(),
notificationID: text("notification_id"),
notificationDeletionDate: timestamp("notification_deletion_date")
});
const validStatuses = ["claimed", "confirmed", "started"] as const;
const statusEnum = pgEnum("status", validStatuses);
export type SessionStatus = typeof validStatuses[number];

export const trainingsTable = pgTable("training", {
date: text("date").primaryKey(),
host: text("host").notNull(),
status: statusEnum("status").notNull(),
notificationID: text("notification_id"),
notificationDeletionDate: timestamp("notification_deletion_date")
});
When I run drizzle-kit push --config=src/db/config.ts it returns error: type "status" does not exist, how do I fix this?
9 replies
DTDrizzle Team
Created by ethan! on 5/9/2024 in #help
CUUID
is there functionality for cuuid instead of just uuid?
1 replies
DTDrizzle Team
Created by ethan! on 4/28/2024 in #help
Issue with JSON + TypScript
Here's my code:
.findFirst({ where: eq(globalBans.offender.id, userID) });
.findFirst({ where: eq(globalBans.offender.id, userID) });
Here's my schema:
interface GlobalBanUser {
id: string;
username: string;
avatar: string;
};

export const globalBans = pgTable("global_bans", {
offender: json("offender").notNull().$type<GlobalBanUser>(),
reason: text("reason").notNull(),
evidence: json("evidence").notNull().$type<string[]>(),
moderator: json("moderator").notNull().$type<GlobalBanUser>(),
notes: text("notes").notNull(),
date: timestamp("date", { mode: "date" }).defaultNow()
});
interface GlobalBanUser {
id: string;
username: string;
avatar: string;
};

export const globalBans = pgTable("global_bans", {
offender: json("offender").notNull().$type<GlobalBanUser>(),
reason: text("reason").notNull(),
evidence: json("evidence").notNull().$type<string[]>(),
moderator: json("moderator").notNull().$type<GlobalBanUser>(),
notes: text("notes").notNull(),
date: timestamp("date", { mode: "date" }).defaultNow()
});
Here's my error:
Property 'id' does not exist on type 'PgColumn<{ name: "offender"; tableName: "global_bans"; dataType: "json"; columnType: "PgJson"; data: GlobalBanUser; driverParam: unknown; notNull: true; hasDefault: false; enumValues: undefined; baseColumn: never; }, {}, {}>'.
Property 'id' does not exist on type 'PgColumn<{ name: "offender"; tableName: "global_bans"; dataType: "json"; columnType: "PgJson"; data: GlobalBanUser; driverParam: unknown; notNull: true; hasDefault: false; enumValues: undefined; baseColumn: never; }, {}, {}>'.
2 replies