feat: update references

This commit is contained in:
Mauricio Siu
2025-02-14 02:18:53 -06:00
parent 5c24281f72
commit ca217affe6
41 changed files with 416 additions and 381 deletions

View File

@@ -7,13 +7,13 @@ export type Server = typeof server.$inferSelect;
export const createServer = async (
input: typeof apiCreateServer._type,
adminId: string,
userId: string,
) => {
const newServer = await db
.insert(server)
.values({
...input,
adminId: adminId,
userId: userId,
})
.returning()
.then((value) => value[0]);
@@ -45,9 +45,9 @@ export const findServerById = async (serverId: string) => {
return currentServer;
};
export const findServersByAdminId = async (adminId: string) => {
export const findServersByUserId = async (userId: string) => {
const servers = await db.query.server.findMany({
where: eq(server.adminId, adminId),
where: eq(server.userId, userId),
orderBy: desc(server.createdAt),
});