Skip to content

Commit 1316f1e

Browse files
committed
Removing users from deleted class - no need to show error message here about the class
The problem with showing an error here is that the removal can be partially successful. The error doesn't show up when removing, but rather when undoing the removal - these changes simply proceed along as if everything went okay because ... you're removing users from the class and, technically, they've already been removed from the class :)
1 parent 6a89e60 commit 1316f1e

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

kolibri/plugins/facility/assets/src/views/users/sidePanels/RemoveFromClassSidePanel.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,20 @@
268268
kind: UserKinds.COACH,
269269
}))
270270
: [];
271-
await Promise.all([
272-
enrollments.length
273-
? MembershipResource.saveCollection({ data: enrollments })
274-
: Promise.resolve(),
275-
assignments.length
276-
? RoleResource.saveCollection({ data: assignments })
277-
: Promise.resolve(),
278-
]);
271+
try {
272+
await Promise.all([
273+
enrollments.length
274+
? MembershipResource.saveCollection({ data: enrollments })
275+
: Promise.resolve(),
276+
assignments.length
277+
? RoleResource.saveCollection({ data: assignments })
278+
: Promise.resolve(),
279+
]);
280+
} catch (_) {
281+
showErrorWarning.value = true;
282+
} finally {
283+
loading.value = false;
284+
}
279285
props.onChange({
280286
affectedClasses: selectedOptions.value,
281287
resetSelection: true,

0 commit comments

Comments
 (0)