bugfix: assignment silently failing #1938
Open
+47
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When a Supervisor assigns a person not in their department to a task it silently fails. The API returns an empty list [] for the
api/actions/persons/<id>/assigncall, but the UI updates the assignee for the task and it looks to the user like that task has been successfully assigned. On page reload the assignment "disappears".Similarly if a Supervisor selects a task in their department, then more tasks including those NOT in their department and assigns them to a user in their team, then the api returns a list of tasks successfully assigned omitting those not assigned for whatever reason. Again the UI shows ALL selected tasks assigned instead of just the successfully assigned and a page reload fixes this.
Solution

Get the assigned task ids back from the api response and only update the tasks for those. Show an error if any failed assignments.