You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working with Medusa V2 and trying to create a custom service inside the modules folder. However, I'm unsure how to modify the SQL table using this service in the new version.
In Medusa V1, I could easily modify the table by doing something like this in the service:
This allowed me to create and save records in the SQL table using methods like create and save.
However, in Medusa V2, I'm not sure how to achieve this. Specifically, I’m confused about how to make the create, save, and other repository methods work with the new architecture.
How do I properly access the repository in Medusa V2?
How can I implement create and save operations on a custom model in the new version?
Any help or guidance on how to perform these operations in Medusa V2 would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm currently working with Medusa V2 and trying to create a custom service inside the modules folder. However, I'm unsure how to modify the SQL table using this service in the new version.
In Medusa V1, I could easily modify the table by doing something like this in the service:
I was able to access the repository like this:
or like this:
This allowed me to create and save records in the SQL table using methods like
create
andsave
.However, in Medusa V2, I'm not sure how to achieve this. Specifically, I’m confused about how to make the
create
,save
, and other repository methods work with the new architecture.Any help or guidance on how to perform these operations in Medusa V2 would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions