#507 [Pull] Fix infined load on Issues/Pulls if they dont exist

Closed
opened 1 day ago by mmarif · 6 comments
mmarif commented 1 day ago

If issues/pr are disabled, catch the correct response call and show proper layout.

close #53


Original Pull att :https://gitea.com/gitnex/GitNex/pulls/507

Merged with: 34f8f82b63

If issues/pr are disabled, catch the correct response call and show proper layout. close #53 --- Original Pull att :https://gitea.com/gitnex/GitNex/pulls/507 Merged with: 34f8f82b6306ad643c981f4c66dd8c247acad652
mmarif added this to the 3.0.0 milestone 1 day ago
mmarif added the
Bug
label 1 day ago
mmarif added the
LGTM-done
label 1 day ago
mmarif was assigned by 6543 1 day ago
6543 commented 1 day ago
Collaborator

can we use switch case for httpStatus checks in gennerel?

I'll pusch a commit

can we use switch case for httpStatus checks in gennerel? I'll pusch a commit
6543 commented 1 day ago
Collaborator

@mmarif I would say the first batch got in ...

@mmarif I would say the first batch got in ...
6543 commented 1 day ago
Collaborator

@mmarif @opyale I would add a new coding rule: on a api call always check the http code since this indicate if it succeeded or not and if there are more than 2 posible codes use switch-case instead of else-if-blocks

https://try.gitea.io/api/swagger#/repository/repoGetAllCommits
-> expected returns are 200, 404 and 409 for example

@mmarif @opyale I would add a new coding rule: on a api call always check the http code since this indicate if it succeeded or not and if there are more than 2 posible codes use switch-case instead of else-if-blocks https://try.gitea.io/api/swagger#/repository/repoGetAllCommits -> expected returns are 200, 404 and 409 for example
mmarif commented 1 day ago
Owner

I would add a new coding rule: on a api call always check the http code since this indicate if it succeeded or not and if there are more than 2 posible codes use switch-case instead of else-if-blocks

I am fine with it. Just curious, what are the advantages of switch over if?

> I would add a new coding rule: on a api call always check the http code since this indicate if it succeeded or not and if there are more than 2 posible codes use switch-case instead of else-if-blocks I am fine with it. Just curious, what are the advantages of switch over if?
mmarif commented 1 day ago
Owner

@6543 This PR with the your commits became very huge and unreadable.

Can we focus on the issue and pr calls in this PR which will fix the inifinite loop issue?

Reformat code: new PR

Change to switch cases: new PR

What you think?

@6543 This PR with the your commits became very huge and unreadable. Can we focus on the issue and pr calls in this PR which will fix the inifinite loop issue? Reformat code: new PR Change to switch cases: new PR What you think?
6543 commented 1 day ago
Collaborator

@mmarif removed

@mmarif removed
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.