/api/directory/[id], /api/directory/create Endpoint 구현

This commit is contained in:
static
2025-01-01 21:37:12 +09:00
parent 363f809d02
commit 0c9c07063d
7 changed files with 246 additions and 0 deletions

View File

@@ -35,6 +35,15 @@ export const getInitialMek = async (userId: number) => {
return meks[0] ?? null;
};
export const getActiveMekVersion = async (userId: number) => {
const meks = await db
.select({ version: mek.version })
.from(mek)
.where(and(eq(mek.userId, userId), eq(mek.state, "active")))
.execute();
return meks[0]?.version ?? null;
};
export const getAllValidClientMeks = async (userId: number, clientId: number) => {
return await db
.select()