Skip to content

Commit ef00646

Browse files
committed
Fix design + lock of groups
1 parent 5c06299 commit ef00646

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

back-end/src/base/groups/groups.service.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ export class GroupsService {
3333

3434
//TODO: Waiting for the trello part
3535
const retro = createRetroGroup(course, user);
36-
course.groups.forEach(async (groups, index) => {
36+
await this.deleteCourseRetro(courseId);
37+
await this.emptyCourseProjects(courseId);
38+
for (const groups of course.groups) {
39+
const index = course.groups.indexOf(groups);
3740
const projectDocument: CanvasRoom = {
3841
owner: userId,
3942
meta: {
@@ -57,12 +60,24 @@ export class GroupsService {
5760
{ _id: new ObjectId(courseId) },
5861
{ $push: { projects: canvas.insertedId } },
5962
);
60-
});
63+
}
6164

6265
const newRetro = await this.retrospectiveRepository.createRetrospective(retro);
6366
await this.coursesRepository.updateOneCourse(
6467
{ _id: new ObjectId(courseId) },
6568
{ $set: { retro: newRetro.insertedId, isLocked: true } },
6669
);
6770
}
71+
async emptyCourseProjects(courseId: string) {
72+
await this.coursesRepository.updateOneCourse(
73+
{ _id: new ObjectId(courseId) },
74+
{ $set: { projects: [] } },
75+
);
76+
}
77+
async deleteCourseRetro(courseId: string) {
78+
await this.coursesRepository.updateOneCourse(
79+
{ _id: new ObjectId(courseId) },
80+
{ $set: { retro: null } },
81+
);
82+
}
6883
}

front-end/src/components/RollCallComponents/GroupsComponent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="grid grid-cols-3 gap-8 mx-auto w-3/4 max-w-2x h-100">
2+
<div class="grid grid-cols-3 gap-8 mx-auto w-3/4 max-w-2x mb-4 h-100">
33
<div
44
v-for="(group, index) in groups"
55
:key="group.id"

front-end/src/components/RollCallComponents/StudentListComponent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div
33
v-if="studentList && courseId"
4-
class="w-7/12 flex mx-auto md:w-6/12 mt-2.5 align-left justify-start"
4+
class="w-7/12 flex mx-auto md:w-6/12 mt-2.5 mb-4 align-left justify-start"
55
>
66
<table class="text-center w-full">
77
<caption hidden>

0 commit comments

Comments
 (0)