boolean-uk / team-dev-server

3 stars 12 forks source link

#61 As a developer, so I can get visibility on the activity of the application, I want significant events users take to be shown to be in a dashboard. #286

Closed mnmin closed 1 year ago

mnmin commented 1 year ago

User Story

Ensure all existing functions have try catches (where required) for task #61 As a developer, so I can get visibility on the activity of the application, I want significant events users take to be shown to be in a dashboard.

Tasks

Add try catch error and if statements in functions to improve event registration.

Check List

1) Currently, in controllers --> admin.js --> in updateUserRoleById function an Admin can change his role to student or teacher. Add an if statement to prevent the Admin from doing this.

2) In controllers --> excercise.js add try catch errors to the following functions: deleteExercise, getAllExercises and GetExerciseByID.

3) In controllers --> cohort.js --> in getById add an if statement if foundCohort is null.

Auenc commented 1 year ago

I think this needs some more detail. If the goal is to show significant events on a dashboard to developers we will need some more things. For instance:

mnmin commented 1 year ago

I'm working with Ning on #61 from team user profile and I think that she mentioned in detail everything that you wrote above. When we were adding myEmitter.emit events we realised that we couldn't do it for some of the functions because they lacked try catch and if statements, to record the errors for the dashboard. After I've added the try catch and if statements I'm going to talk with Ning to discuss the messages that we are going to discuss on the dashboard

Auenc commented 1 year ago

Ah okay. In that case, can you update the original issue text to mention that this is specifically to ensure all existing functions have try catches (where required).

mnmin commented 1 year ago

done

Auenc commented 1 year ago

Looks good to me :)