Files
klatab/utils/getDefaultFilter.ts

7 lines
416 B
TypeScript
Raw Permalink Normal View History

2024-09-15 16:03:10 +02:00
export const getDefaultFilter = (userInformation) => {
if (!userInformation) return null;
let type = userInformation.usertype == 'pupil' ? 'class' : 'teacher';
let value = userInformation.usertype == 'pupil' ? userInformation.classid : userInformation.id;
2024-09-18 10:53:23 +02:00
let group = userInformation.usertype == 'pupil' ? String(userInformation.group) : '1';
return { type: type, value: value, group: group };
2024-09-15 16:03:10 +02:00
};