chaynHQ / bloom-frontend

Code for the for the frontend of the Bloom service.
https://bloom.chayn.co/
MIT License
27 stars 46 forks source link

Add Rate this session feature to Image Based Abuse course #1060

Closed eleanorreem closed 1 month ago

eleanorreem commented 1 month ago

Overview

We made live our rate this session feedback form. See previous issue for context:

858

We need to add this to our Image based abuse course. This is in /bloom-frontend/pages/courses/image-based-abuse-and-rebuilding-ourselves/[sessionSlug].tsx. This course has its own template as it has a slightly different structure

Action Items

ckirby19 commented 1 month ago

Happy to pick this up or to leave this for someone else to get some experience with this area of the code :)

github-actions[bot] commented 1 month ago

Thank you @ckirby19 you have been assigned this issue! Please follow the directions in our Contributing Guide. We look forward to reviewing your pull request shortly ✨


Support Chayn's mission? ⭐ Please star this repo to help us find more contributors like you! Learn more about Chayn here and explore our projects. 🌸

ckirby19 commented 1 month ago

Hi, I am just working on this ticket but find the following problem, not sure if it is just me? Possibly I need to seed the database again? If I start any of the courses in "Image-based abuse" or "Reclaiming resilience", I get the following backend error and those courses are never shown to have started even if I start the videos (thus I cannot test the feedback form)

ERROR [error] Failed POST "/api/v1/session-user" (IP address: ::ffff:172.18.0.1, requestUserId: 5490d2ca-34c1-46b7-ad30-6cf8617054e0) - status: 404, message: SESSION NOT FOUND - in 6ms

image

eleanorreem commented 1 month ago

@ckirby19 - I get the same error. I think it might be that this course was added after our test database dump was created so the database is out of sync with the site. The fact that the course is not in the database means the session_user rows are not created when you start a course.

There are 2 options to fix this. You could manually add rows in the courses/ sessions tables for this course or wait for me or @kyleecodes to refresh the database dump. However this might take a little bit! If you can be bothered to do it manually, you could use the storyblok webhook which is how the courses/sessions are normally added. These would be the steps:

If you would like to seed all the courses, you just need to get the storyblok id of each course and ping the webhook in the same format.

Sorry for the hiccup!

ckirby19 commented 1 month ago

Hi, I tried what you suggested above but get the following error: "message": "Storyblok webhook failed - error getting story from storyblok - [object Object]"

eleanorreem commented 1 month ago

Ah thats annoying. Out of interest, did you have the storyblok public token in your env file?

kyleecodes commented 1 month ago

Closing this issue as the PR has been merged. @ckirby19 please let us know if you run into this issue again and how we can reproduce the error. Thanks!