Finish teacher edt page
This commit is contained in:
parent
dcee100c8a
commit
e4535a9c7e
2 changed files with 5 additions and 2 deletions
|
@ -85,4 +85,4 @@ document.querySelectorAll("td").forEach(td => {
|
||||||
marksdetailsbackground.addEventListener("click", () => {
|
marksdetailsbackground.addEventListener("click", () => {
|
||||||
details.classList.add("invisible");
|
details.classList.add("invisible");
|
||||||
marksdetailsbackground.classList.add("invisible");
|
marksdetailsbackground.classList.add("invisible");
|
||||||
})
|
});
|
||||||
|
|
|
@ -21,7 +21,7 @@ module.exports = socket => {
|
||||||
include: [
|
include: [
|
||||||
{model: models.User, attributes: ["email", "firstName", "lastName"]},
|
{model: models.User, attributes: ["email", "firstName", "lastName"]},
|
||||||
{model: models.Group, include: models.Semester},
|
{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);
|
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) {
|
if (data && data.teachers) {
|
||||||
for (let teacher of data.teachers) {
|
for (let teacher of data.teachers) {
|
||||||
let t = await models.User.findByPk(teacher);
|
let t = await models.User.findByPk(teacher);
|
||||||
|
|
Reference in a new issue