/api/client/list Endpoint 추가

This commit is contained in:
static
2024-12-29 22:03:39 +09:00
parent 97f6e1e32f
commit 4a10ba0fbf
4 changed files with 28 additions and 10 deletions

View File

@@ -21,12 +21,8 @@ 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 getAllUserClients = async (userId: number) => {
return await db.select().from(userClient).where(eq(userClient.userId, userId)).execute();
};
export const getUserClient = async (userId: number, clientId: number) => {