Skip to content

Commit

Permalink
Simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
a-gubskiy committed Jan 30, 2025
1 parent 1e9ada9 commit a4ba95e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/CampusClient.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ApplicationConfiguration from './ApplicationConfiguration';
import * as Security from './Security';

/**
* Application configuration
Expand Down Expand Up @@ -150,12 +151,14 @@ export const getCurrentUser = async (ignoreCache) => {
const user = await response.json();

if (!!user) {
user.modules = ['profile', 'help'];
user.modules = [
Security.Modules.Information,
Security.Modules.PersonalArea,
];

console.log(user);

if (!!user.studentProfile) {
user.modules = ['profile', 'help', 'EmploymentSystem'];
user.modules.push(Security.Modules.EmploymentSystem);
}

localStorage.setItem(cachedUserInfoKey, JSON.stringify(user));
Expand Down
4 changes: 2 additions & 2 deletions src/Security.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const hasProfile = (user, profile) => {
};

export const Modules = {
PersonalArea: 'profile',
Information: 'help',
PersonalArea: 'PersonalArea',
Information: 'Information',
EmploymentSystem: 'EmploymentSystem'
};

Expand Down

0 comments on commit a4ba95e

Please sign in to comment.