mirror of
https://github.com/khairul169/github-leaderboard.git
synced 2026-09-17 09:53:21 +07:00
feat: add leaderboard category
This commit is contained in:
@@ -34,7 +34,7 @@ export const fetchRepoContributors = async (
|
||||
|
||||
const [result] = await db
|
||||
.update(repositories)
|
||||
.set({ contributors })
|
||||
.set({ contributors, isPending: false, isError: false })
|
||||
.where(eq(repositories.id, data.id))
|
||||
.returning();
|
||||
|
||||
@@ -44,3 +44,12 @@ export const fetchRepoContributors = async (
|
||||
|
||||
await queue.add("calculateUserPoints", { userId: result.userId });
|
||||
};
|
||||
|
||||
export const onFetchRepoContribFailed = async (
|
||||
data: FetchRepoContributorsType
|
||||
) => {
|
||||
await db
|
||||
.update(repositories)
|
||||
.set({ isPending: false, isError: true })
|
||||
.where(eq(repositories.id, data.id));
|
||||
};
|
||||
|
||||
@@ -28,6 +28,7 @@ export const fetchUserRepos = async (data: FetchUserRepos) => {
|
||||
...repo,
|
||||
userId: user.id,
|
||||
lastUpdate: repo.lastUpdate.toISOString(),
|
||||
isPending: true,
|
||||
};
|
||||
|
||||
const [existing] = await tx
|
||||
|
||||
Reference in New Issue
Block a user