1
0
Fork 0

Finish teacher edt page

This commit is contained in:
Ethanell 2021-01-20 22:26:13 +01:00
parent dcee100c8a
commit e4535a9c7e
2 changed files with 5 additions and 2 deletions

View file

@ -85,4 +85,4 @@ document.querySelectorAll("td").forEach(td => {
marksdetailsbackground.addEventListener("click", () => {
details.classList.add("invisible");
marksdetailsbackground.classList.add("invisible");
})
});

View file

@ -21,7 +21,7 @@ module.exports = socket => {
include: [
{model: models.User, attributes: ["email", "firstName", "lastName"]},
{model: models.Group, include: models.Semester},
{model: models.Semester, include: models.Group}
{model: models.Semester, include: {model: models.Group, include: models.Semester}}
]
};
@ -48,6 +48,9 @@ module.exports = socket => {
addWhere(options, 1, "id", g.id);
}
}
if (socket.request.session.user.permissions === 2)
if (data && !data.teachers)
data.teachers = [socket.request.session.user.email];
if (data && data.teachers) {
for (let teacher of data.teachers) {
let t = await models.User.findByPk(teacher);