Open wavesinaroom opened 12 months ago
The model-view-controller flow is working now but there are a couple of things to improve:
Admin can delete lessons by clicking on a delete button next to each lesson rendered details. So, for this features I need to work on:
1 Render existing lessons as a table with rows and columns 2 Add a delete button nex to each rendered lesson.
Optionally, I'll add a confirmation panel to help admin prevent mistakes.
Lessons deletion is ready but I discovered routes weren't working properly. The bug happened when browsing between create and delete sections. This is not hard to fix fortunately, apparently I only need to to change the way urls are generated in delete and create lessons views and routes.
On the other hand, the style field in the create section stops lesson creation because for validation throws and error when the input consists of two or more words.
I didn't have much trouble coding the student deletion feature. I'd like to improve it with a specific confirmation message but that will come later. I'm doing that because I can't spend much time on adding details so this improvement will go to my mental backlog.
When rendering lessons for booking for a student I immediately noticed that number of spots and available spots number were the same. I feel the bug is in the lesson creation function inside the controller.
I learned how to add elements to array in documents and increase values in document fields. There's just a problem with booking lessons which is students being able to book the same lesson more than once.
I wished I could implement flash messages to give users more info about booking lessons exceptions. That's not possible just now because connect-flash needs express sessions and that will come later when admin and students features are ready. For now, I'm notifying errors with res.send() till I'm coding sessions and passwords.
Admin controller is currently at a really good functioning state. There's only one flaw that I want to improve when I'm done with the student controller that is flash messages. If they are implemented, the overall user experience on exceptions will be much better because users could get feedback on those fields that need amendment. Aside for that that branch is ready for merging.
UX is enormously improved with user feedback prompted on errors.
Admin controller perform the following actions by admin user: