/api/mek/list, /api/mek/register Endpoint 구현

This commit is contained in:
static
2024-12-29 21:52:33 +09:00
parent 3664ad66ac
commit 97f6e1e32f
6 changed files with 186 additions and 24 deletions

View File

@@ -21,6 +21,14 @@ export const createUserClient = async (userId: number, clientId: number) => {
await db.insert(userClient).values({ userId, clientId }).execute();
};
export const getAllValidUserClients = async (userId: number) => {
return await db
.select()
.from(userClient)
.where(and(eq(userClient.userId, userId), eq(userClient.state, "active")))
.execute();
};
export const getUserClient = async (userId: number, clientId: number) => {
const userClients = await db
.select()