7 lines
416 B
TypeScript
7 lines
416 B
TypeScript
export const getDefaultFilter = (userInformation) => {
|
|
if (!userInformation) return null;
|
|
let type = userInformation.usertype == 'pupil' ? 'class' : 'teacher';
|
|
let value = userInformation.usertype == 'pupil' ? userInformation.classid : userInformation.id;
|
|
let group = userInformation.usertype == 'pupil' ? String(userInformation.group) : '1';
|
|
return { type: type, value: value, group: group };
|
|
}; |