#MedusaJs Product Review update

15 messages · Page 1 of 1 (latest)

paper agate
#

I was following the tutorial on adding a product review to my MedusaJs Store and ran into a lot of errors
this is the link to the tutorial:
https://medusajs.com/blog/how-to-add-product-reviews-to-your-medusa-server-and-next-js-storefront/
it uses Javascript and not the Typescript version of Medusa which causes a lot of errors. Also defining the EntityRepository is deprecated.

is there any other tutorial teaching the basics of defining new entities and using them inside of new routes for a beginner ?
It would be wonderful if someone could do a rewrite of this useful feature with the updated libraries

bleak zealot
paper agate
#

I am getting errors while building this project

#

const productReviewRepository = this.activeManager_.withRepository(this.productReviewRepository_)

#

Argument of type 'Repository<ProductReview>' is not assignable to parameter of type 'Repository<any> & Repository<ProductReview

bleak zealot
#

If you are building it yourself instead of installing from npm, make sure you use yarn link for all of the peer dependencies.

#

You can also just copy the code from /src into your Medusa server src directory.

paper agate
bleak zealot
#

That usually means the service is not being recognized. Are you using medusa v1.10? Try restarting the server, too.

#

You could just do yarn add medusa-plugin-ratings and add it to your plugin array in your config file

paper agate
#

I am using
"@chrome thunderjs/admin": "^3.0.0",
"@chrome thunderjs/cache-inmemory": "^1.8.0",
"@chrome thunderjs/cache-redis": "^1.8.0",
"@chrome thunderjs/event-bus-local": "^1.8.0",
"@chrome thunderjs/event-bus-redis": "^1.8.0",
"@chrome thunderjs/medusa": "^1.8.0",
"@chrome thunderjs/medusa-cli": "^1.3.9"

#

Could it be related to redis ? Because I have not set that up

#

I really want to understand how to create new tables and new api routes for medusa. The only simple tutorial I found was the product review which implemented a useful feature on top of medusa, but unfortunately turned out to be very confusing. I have deleted and remade the database and restarted the server several times to no avail

bleak zealot
#

It's unlikely other plugins are causing an issue. If you copy all the stuff from src into your medusa folder in a clean, v 1.10 install, and then do medusa migrations run, and then restart your backend, do the new routes still not work?

#

If you push your code to a github repo, I will take a look.