In the backend route /api/member/tutorNotes, the pseudocode is like this:
if you are an admin {
list = find all tutor notes
} else if you are an instructor {
list = find all the tutor notes for this instructors courses
}
now, add to that list, all tutor notes where the current user is a tutor.
What we should do is replace this with:
add all tutor notes that do not duplicate ones already in the list. There are a variety of ways to do this, include
making the list as a "set" and then converting to a list
using a loop to add them in one by one, only if not already in the list
In the backend route
/api/member/tutorNotes
, the pseudocode is like this:What we should do is replace this with: add all tutor notes that do not duplicate ones already in the list. There are a variety of ways to do this, include
The problem line of code is this one:
What we want instead, is instead of
allAll
we wantallAllThatAreNotAlreadyInTheList
but that's not a method as far as I know....Here's one possible approach (not tested):