Skip to content

Commit

Permalink
rename excludeFromSync attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinOehlerkingCap committed Nov 4, 2024
1 parent 64bfee2 commit 41413bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions controllers/courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const getSyncedElements = (
startDate,
untilDate,
syncedWithGroup,
syncExcludedFields: course.syncExcludedFields?.join(','),
excludeFromSync: course.excludeFromSync?.join(','),
};

return selectedElements;
Expand Down Expand Up @@ -311,7 +311,7 @@ const editCourseHandler = (req, res, next) => {
const isTeacherInGroup = teacherIds.some((tid) => tid === res.locals.currentUser._id);
const isTeacher = res.locals.currentUser.roles.map((role) => role.name).includes('teacher');
if (!isTeacherInGroup && isTeacher) {
course.syncExcludedFields = ['teachers'];
course.excludeFromSync = ['teachers'];
course.teacherIds = [res.locals.currentUser._id];
} else {
course.teacherIds = teacherIds;
Expand Down Expand Up @@ -589,7 +589,7 @@ router.post('/', (req, res, next) => {
req.body.untilDate = untilDate.toDate();
}

const keys = ['teacherIds', 'substitutionIds', 'classIds', 'userIds', 'syncExcludedFields'];
const keys = ['teacherIds', 'substitutionIds', 'classIds', 'userIds', 'excludeFromSync'];
req.body = strToPropsArray(req.body, keys);

req.body.features = [];
Expand Down
2 changes: 1 addition & 1 deletion views/courses/create-course.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
</div>

{{#if syncedWithGroup}}
<input type="hidden" id="syncExcludedFields" name="syncExcludedFields" value="{{syncExcludedFields}}">
<input type="hidden" id="excludeFromSync" name="excludeFromSync" value="{{excludeFromSync}}">
{{/if}}

</section>
Expand Down
2 changes: 1 addition & 1 deletion views/courses/edit-course.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
</div>

{{#if course.syncedWithGroup}}
<input type="hidden" id="syncExcludedFields" name="syncExcludedFields" value="{{syncExcludedFields}}">
<input type="hidden" id="excludeFromSync" name="excludeFromSync" value="{{excludeFromSync}}">
{{/if}}

{{#unless @root.course.isArchived}}
Expand Down

0 comments on commit 41413bb

Please sign in to comment.