Add constant for local storage key value

This commit is contained in:
2023-09-06 10:16:12 +07:00
parent 7e6cb8e795
commit 09d7f82813
2 changed files with 11 additions and 1 deletions
@@ -11,9 +11,15 @@ export const MESSAGE = {
DEFAULT_TITLE_ERROR_POPUP: 'Error',
USER_EXIST_ERROR: 'User is exists! Please try another email!',
};
export const BTN_CONTENT = {
GOT_IT: 'Got it!',
OK: 'Ok',
};
export const LOCAL_STORAGE = {
ACCESS_TOKEN: 'accessToken',
};
export const TYPE_POPUP = { success: 'success', error: 'error' };
export const MARK_ICON = { success: 'check', error: 'error' };
@@ -1,3 +1,4 @@
import { LOCAL_STORAGE } from '../constants/constant';
import { createToken } from '../helpers/helpers';
import CommonService from './commonService';
import LocalStorageService from './localStorageService';
@@ -81,6 +82,9 @@ export default class UserService extends CommonService {
this.save(newUserData);
// Add access token to local storage
LocalStorageService.add('accessToken', newUserData.accessToken);
LocalStorageService.add(
LOCAL_STORAGE.ACCESS_TOKEN,
newUserData.accessToken,
);
}
}