6 lines
349 B
TypeScript
6 lines
349 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;
|
|
return { type: type, value: value, group: String(userInformation.group) };
|
|
}; |