fix(product, types): correct path for migration files + fix types on products service module (#4348)
* chore: correct path for migration files * chore: resolve the path for migrations to be picked up * chore: fix types on product service interface * chore: update changeset to reflect type changes * chore: changed changeset to the correct format
This commit is contained in:
6
.changeset/slow-chicken-report.md
Normal file
6
.changeset/slow-chicken-report.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/product": patch
|
||||
"@medusajs/types": patch
|
||||
---
|
||||
|
||||
fix(product, types): correct path for migration files + fix types on product module service interface
|
||||
@@ -1,6 +1,5 @@
|
||||
import { MikroORM, PostgreSqlDriver } from "@mikro-orm/postgresql"
|
||||
import { ProductServiceInitializeOptions } from "../types"
|
||||
import { Utils } from "@mikro-orm/core"
|
||||
|
||||
export async function createConnection(
|
||||
database: ProductServiceInitializeOptions["database"],
|
||||
@@ -20,7 +19,7 @@ export async function createConnection(
|
||||
tsNode: process.env.APP_ENV === "development",
|
||||
type: "postgresql",
|
||||
migrations: {
|
||||
path: Utils.detectTsNode() ? "src/migrations" : "dist/migrations",
|
||||
path: __dirname + "/../migrations",
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -21,37 +21,37 @@ export interface IProductModuleService<
|
||||
TProductCategory = any
|
||||
> {
|
||||
list(
|
||||
filter: FilterableProductProps,
|
||||
filters?: FilterableProductProps,
|
||||
config?: FindConfig<ProductDTO>,
|
||||
context?: SharedContext
|
||||
sharedContext?: SharedContext
|
||||
): Promise<ProductDTO[]>
|
||||
|
||||
listAndCount(
|
||||
filter: FilterableProductProps,
|
||||
filters?: FilterableProductProps,
|
||||
config?: FindConfig<ProductDTO>,
|
||||
context?: SharedContext
|
||||
sharedContext?: SharedContext
|
||||
): Promise<[ProductDTO[], number]>
|
||||
|
||||
listTags(
|
||||
filter: FilterableProductTagProps,
|
||||
filters?: FilterableProductTagProps,
|
||||
config?: FindConfig<ProductTagDTO>,
|
||||
context?: SharedContext
|
||||
sharedContext?: SharedContext
|
||||
): Promise<ProductTagDTO[]>
|
||||
|
||||
listVariants(
|
||||
filter: FilterableProductVariantProps,
|
||||
filters?: FilterableProductVariantProps,
|
||||
config?: FindConfig<ProductVariantDTO>,
|
||||
context?: SharedContext
|
||||
sharedContext?: SharedContext
|
||||
): Promise<ProductVariantDTO[]>
|
||||
|
||||
listCollections(
|
||||
filter: FilterableProductCollectionProps,
|
||||
filters?: FilterableProductCollectionProps,
|
||||
config?: FindConfig<ProductCollectionDTO>,
|
||||
context?: SharedContext
|
||||
sharedContext?: SharedContext
|
||||
): Promise<ProductCollectionDTO[]>
|
||||
|
||||
listCategories(
|
||||
filters: FilterableProductCategoryProps,
|
||||
filters?: FilterableProductCategoryProps,
|
||||
config?: FindConfig<ProductCategoryDTO>,
|
||||
sharedContext?: SharedContext
|
||||
): Promise<ProductCategoryDTO[]>
|
||||
|
||||
Reference in New Issue
Block a user