Skip to content

Commit 82885db

Browse files
fixes
1 parent 218be4c commit 82885db

File tree

16 files changed

+26
-30
lines changed

16 files changed

+26
-30
lines changed

backend/internal/app/auth/domain.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ type User struct {
3434
type GithubUserResponse struct {
3535
GithubId int `json:"id"`
3636
GithubUsername string `json:"login"`
37-
AvatarUrl string `json:"avatarUrl"`
37+
AvatarUrl string `json:"avatar_url"`
3838
Email string `json:"email"`
39-
IsAdmin bool `json:"isAdmin"`
39+
IsAdmin bool `json:"is_admin"`
4040
}
4141

4242
type AdminLoginRequest struct {

backend/internal/app/contribution/service.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ func (s *service) GetContributionType(ctx context.Context, contribution Contribu
179179
var stateReason string
180180
if issuePayload, ok := contributionPayload[PayloadIssueKey]; ok {
181181
issue = issuePayload.(map[string]interface{})
182-
if stateReasonVal, ok := issue[PayloadStateReasonKey]; ok {
183-
stateReason = stateReasonVal.(string)
182+
if stateReasonVal, ok := issue[PayloadStateReasonKey]; ok && stateReasonVal != nil {
183+
if v, ok := stateReasonVal.(string); ok {
184+
stateReason = v
185+
}
184186
}
185187
}
186188

backend/internal/app/github/domain.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ type FetchRepositoryDetailsResponse struct {
1212
Id int `json:"id"`
1313
Name string `json:"name"`
1414
Description string `json:"description"`
15-
LanguagesURL string `json:"languagesUrl"`
16-
UpdateDate time.Time `json:"updatedAt"`
15+
LanguagesURL string `json:"languages_url"`
16+
UpdateDate time.Time `json:"updated_at"`
1717
RepoOwnerName RepoOwner `json:"owner"`
18-
ContributorsUrl string `json:"contributorsUrl"`
19-
RepoUrl string `json:"repoUrl"`
18+
ContributorsUrl string `json:"contributors_url"`
19+
RepoUrl string `json:"html_url"`
2020
}
2121

2222
type RepoLanguages map[string]int
@@ -32,7 +32,7 @@ type RepoContributorsResponse struct {
3232
type FetchRepositoryContributorsResponse struct {
3333
Id int `json:"id"`
3434
Name string `json:"name"`
35-
AvatarUrl string `json:"avatarUrl"`
36-
GithubUrl string `json:"githubUrl"`
35+
AvatarUrl string `json:"avatar_url"`
36+
GithubUrl string `json:"github_url"`
3737
Contributions int `json:"contributions"`
3838
}

frontend/src/api/queries/Auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const useGithubOauthLogin = (code: string | null) => {
1717
return useQuery({
1818
queryKey: [GITHUB_OAUTH_LOGIN_QUERY_KEY, code],
1919
queryFn: () => githubOauthLogin(code!),
20-
enabled: !!code
20+
enabled: !!code,
21+
retry: false,
2122
});
2223
};

frontend/src/features/Login/components/LoginComponent.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,24 @@ import { useEffect } from "react";
1212
import { setAccessToken } from "@/shared/utils/local-storage";
1313
import { useGithubOauthLogin } from "@/api/queries/Auth";
1414
import { toast } from "sonner";
15-
import { useLoggedInUser } from "@/api/queries/UserProfileDetails";
16-
import { ACCOUNT_INFO_PATH } from "@/shared/constants/routes";
1715
import githubIcon from "@/assets/github-white-icon.svg";
1816
const LoginComponent = () => {
1917
const [searchParams] = useSearchParams();
2018
const navigate = useNavigate();
2119

2220
const code = searchParams.get("code");
21+
console.log("code", code);
2322
const { data, isSuccess, isError } = useGithubOauthLogin(code);
24-
25-
const { refetch } = useLoggedInUser(false);
26-
23+
console.log("data", data);
24+
console.log("isSuccess", isSuccess);
2725
useEffect(() => {
2826
if (!code) return;
2927

3028
if (isSuccess && data?.data) {
3129
const token = data.data;
3230
setAccessToken(token);
3331

34-
refetch().then(({ data: userData }) => {
35-
if (userData?.data?.isBlocked) {
36-
navigate(ACCOUNT_INFO_PATH);
37-
}
38-
});
39-
32+
console.log("hello");
4033
navigate("/");
4134
}
4235

frontend/src/features/RepositoryDetails.tsx/components/Contributors.tsx renamed to frontend/src/features/RepositoryDetails/components/Contributors.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const ContributorsList = () => {
4949
<ContributorsCard
5050
key={contributor.id}
5151
name={contributor.name}
52-
avatarUrl={contributor.avatarUrl}
53-
githubUrl={contributor.githubUrl}
52+
avatarUrl={contributor.avatar_url}
53+
githubUrl={contributor.github_url}
5454
contributions={contributor.contributions}
5555
/>
5656
))}

frontend/src/features/RepositoryDetails.tsx/components/ContributorsCard.tsx renamed to frontend/src/features/RepositoryDetails/components/ContributorsCard.tsx

File renamed without changes.

frontend/src/features/RepositoryDetails.tsx/components/Languages.tsx renamed to frontend/src/features/RepositoryDetails/components/Languages.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type FC } from "react";
2-
import LanguageCard from "../../RepositoryDetails.tsx/components/LanguagesCard";
32
import { useRepositoryLanguages } from "@/api/queries/Languages";
43
import { useParams } from "react-router-dom";
4+
import LanguageCard from "./LanguagesCard";
55

66
interface LanguagesProps {
77
className?: string;

frontend/src/features/RepositoryDetails.tsx/components/LanguagesCard.tsx renamed to frontend/src/features/RepositoryDetails/components/LanguagesCard.tsx

File renamed without changes.

frontend/src/features/RepositoryDetails.tsx/components/Repository.tsx renamed to frontend/src/features/RepositoryDetails/components/Repository.tsx

File renamed without changes.

0 commit comments

Comments
 (0)