chaynHQ/bloom-frontend

Add Rate this session feature to Image Based Abuse course

Closed this issue · 7 comments

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

  • Add Rate this Session Form to image based abuse form. See this PR and this one for details.
  • Manually test that it works and that the feedback is stored in DB
  • Run Cypress tests
  • Create a PR and tag @eleanorreem

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

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. 🌸

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

@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:

  • Comment out the webhook signature in POST /webhook/storyblok
  • Make a POST request to the endpoint with this body to create the course:
{
    "action": "published",
    "story_id": 291263486
}
  • Make a seperate POST request with the following body to create a database entry for the first session:
{
    "action": "published",
    "story_id": 340723358
}

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!

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

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

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!