Skip to content

Commit

Permalink
ADM-1009 [frontend]: fix the code because the code may be string type
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-yinyuan committed Sep 18, 2024
1 parent 868de92 commit 437c903
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/hooks/useGetMetricsStepsEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const useGetMetricsStepsEffect = (): useGetMetricsStepsEffectInterface =>
} else if (hasRejected && hasFulfilled) {
const rejectedStep = allStepsRes.find((stepInfo) => stepInfo.status === REJECTED);
const code = (rejectedStep as PromiseRejectedResult).reason.code;
if (code === 400 || code === 401 || code === 403 || code === 404) {
if (code == 400 || code == 401 || code == 403 || code == 404) {
setStepFailedStatus(MetricsDataFailStatus.PartialFailed4xx);
} else {
setStepFailedStatus(MetricsDataFailStatus.PartialFailedTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export const useGetSourceControlConfigurationBranchEffect = (): IUseGetSourceCon
}),
),
);
if (response.code === 400 || response.code === 401 || response.code === 403 || response.code === 404) {
if (response.code == 400 || response.code == 401 || response.code == 403 || response.code == 404) {
setStepFailedStatus(MetricsDataFailStatus.AllFailed4xx);
} else if (response.code === 200) {
} else if (response.code == 200) {
setIsGetBranch(true);
dispatch(
updateSourceControlVerifiedResponse({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const useGetSourceControlConfigurationCrewEffect = (): IUseGetSourceContr
} else if (hasRejected && hasFulfilled) {
const rejectedStep = allCrewsRes.find((crewInfo) => crewInfo.status === REJECTED);
const code = (rejectedStep as PromiseRejectedResult).reason.code;
if (code === 400 || code === 401 || code === 403 || code === 404) {
if (code == 400 || code == 401 || code == 403 || code == 404) {
setStepFailedStatus(MetricsDataFailStatus.PartialFailed4xx);
} else {
setStepFailedStatus(MetricsDataFailStatus.PartialFailedTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const useGetSourceControlConfigurationRepoEffect = (): IUseGetSourceContr
} else if (hasRejected && hasFulfilled) {
const rejectedStep = allRepoRes.find((repoInfo) => repoInfo.status === REJECTED);
const code = (rejectedStep as PromiseRejectedResult).reason.code;
if (code === 400 || code === 401 || code === 403 || code === 404) {
if (code == 400 || code == 401 || code == 403 || code == 404) {
setStepFailedStatus(MetricsDataFailStatus.PartialFailed4xx);
} else {
setStepFailedStatus(MetricsDataFailStatus.PartialFailedTimeout);
Expand Down

0 comments on commit 437c903

Please sign in to comment.