Skip to content

Commit

Permalink
reruns formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
xwilson03 committed Sep 10, 2024
1 parent fc51ac1 commit 0803b8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions packages/db/functions/hacker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Hacker } from "../types";

export function getAllHackers(): Promise<Hacker[] | undefined> {
// return _getAllHackers.execute();
return db.query.userCommonData.findMany({
return db.query.userCommonData.findMany({
with: { hackerData: true },
});
}
Expand Down Expand Up @@ -38,10 +38,10 @@ export function getHacker(
// return withTeam
// ? _getHackerByIDWithTeam.execute({ _clerkID: clerkID })
// : _getHackerByIDAlone.execute({ _clerkID: clerkID });
return db.query.userCommonData.findFirst({
where: eq(userCommonData.clerkID, clerkID),
with: { hackerData: (withTeam) ? { with: { team: true } } : true }
});
return db.query.userCommonData.findFirst({
where: eq(userCommonData.clerkID, clerkID),
with: { hackerData: withTeam ? { with: { team: true } } : true },
});
}

// Tag
Expand All @@ -67,8 +67,8 @@ export function getHackerByTag(
// return withTeam
// ? _getHackerByTagWithTeam.execute({ _hackerTag: hackerTag })
// : _getHackerByTagAlone.execute({ _hackerTag: hackerTag });
return db.query.userCommonData.findFirst({
return db.query.userCommonData.findFirst({
where: eq(userCommonData.hackerTag, hackerTag),
with: { hackerData: (withTeam) ? { with: { team: true } } : true },
with: { hackerData: withTeam ? { with: { team: true } } : true },
});
}
8 changes: 4 additions & 4 deletions packages/db/functions/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { User } from "../types";

export function getAllUsers(): Promise<User[] | undefined> {
// return _getAllUsers.execute();
return db.query.userCommonData.findMany();
return db.query.userCommonData.findMany();
}

// ID
Expand All @@ -19,7 +19,7 @@ export function getAllUsers(): Promise<User[] | undefined> {

export function getUser(clerkID: string): Promise<User | undefined> {
// return _getUser.execute({ _clerkID: clerkID });
return db.query.userCommonData.findFirst({
return db.query.userCommonData.findFirst({
where: eq(userCommonData.clerkID, clerkID),
});
}
Expand All @@ -34,7 +34,7 @@ export function getUser(clerkID: string): Promise<User | undefined> {

export function getUserByTag(hackerTag: string): Promise<User | undefined> {
// return _getUserByTag.execute({ _hackerTag: hackerTag });
return db.query.userCommonData.findFirst({
return db.query.userCommonData.findFirst({
where: eq(userCommonData.hackerTag, hackerTag),
})
});
}

0 comments on commit 0803b8c

Please sign in to comment.