medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
24.67k stars 2.43k forks source link

Medusa Service factory returns incorrect type for models that end with 's' letter #8704

Closed vholik closed 4 weeks ago

vholik commented 4 weeks ago

Bug report

Describe the bug

I have created productAttributes module with the model product-attributes. The type of the productAttributesModuleService contains methods like createProductAttributess (notice 2 's' in the end) but once you try to use these methods you would get this error :

error:   service.createProductDetailss is not a function

so you should change it to service.createProductDetails in order to make it work but the typescript shows you an error that function does not exist in that service

System information

Medusa version (including plugins): Node.js version: Database: Operating system: Browser (if relevant):

Steps to reproduce the behavior

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen

Screenshots

If applicable, add screenshots to help explain your problem

Code snippets

If applicable, add code samples to help explain your problem

Additional context

Add any other context about the problem here

olivermrbl commented 4 weeks ago

Nice catch – one we hadn't stumbled upon ourselves yet. Will be fixed and part of a release in the near term.