Skip to content

Commit

Permalink
Fix JSDoc comments JC-726
Browse files Browse the repository at this point in the history
  • Loading branch information
TebyakinaEkaterina committed Aug 23, 2024
1 parent 1f17128 commit 2140a60
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apps/react/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from 'axios';
import { ServerErrorStatus } from '@js-camp/core/models/server-error-status';

import { CONFIG } from './config';
import { LocalStorageService } from './services/localStorageService';
Expand Down Expand Up @@ -26,7 +27,7 @@ http.interceptors.response.use(
response => response,
async error => {
const originalRequest = error.config;
if (error.response.status === 401 && !originalRequest._retry) {
if (error.response.status === ServerErrorStatus.Unauthorized && !originalRequest._retry) {
originalRequest._retry = true;
try {
const refreshToken = LocalStorageService.getRefreshToken();
Expand Down
2 changes: 1 addition & 1 deletion apps/react/src/api/services/authorizationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export namespace AuthorizationService {
}

/**
* Registers the user and receives authorization tokens.
* Refresh access token with refresh token.
* @param refreshToken - Token for refreshing access token.
* @returns - Authorization tokens.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.formWrapper {
--register-form-min-width: 360px;
--login-form-min-width: 360px;

display: flex;
flex-direction: column;
Expand All @@ -13,7 +13,7 @@
}

.form {
min-width: var(--register-form-min-width);
min-width: var(--login-form-min-width);
padding: var(--space-m);
border-radius: 24px;
border: 2px var(--border-color) solid;
Expand Down
2 changes: 1 addition & 1 deletion apps/react/src/store/user/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type UserState = {
/** Error. */
readonly error?: string;

/** Whether the anime are loading or not. */
/** Whether the user is loading or not. */
readonly isLoading: boolean;
};

Expand Down
5 changes: 5 additions & 0 deletions libs/core/models/server-error-status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** Enum for status of server errors. */
export enum ServerErrorStatus {
Unauthorized = 401,
Forbidden = 403,
}

0 comments on commit 2140a60

Please sign in to comment.