Feat(medusa,modules-sdk): Modules SDK package (#3294)
This commit is contained in:
@@ -2,7 +2,7 @@ import ConnectionLoader from "./loaders/connection"
|
||||
import StockLocationService from "./services/stock-location"
|
||||
import * as SchemaMigration from "./migrations/schema-migrations/1665749860179-setup"
|
||||
import * as StockLocationModels from "./models"
|
||||
import { ModuleExports } from "@medusajs/medusa"
|
||||
import { ModuleExports } from "@medusajs/modules-sdk"
|
||||
|
||||
const service = StockLocationService
|
||||
const migrations = [SchemaMigration]
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ConfigurableModuleDeclaration, LoaderOptions } from "@medusajs/medusa"
|
||||
import {
|
||||
ConfigurableModuleDeclaration,
|
||||
LoaderOptions,
|
||||
} from "@medusajs/modules-sdk"
|
||||
|
||||
export default async (
|
||||
{ configModule }: LoaderOptions,
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
import {
|
||||
buildQuery,
|
||||
ConfigurableModuleDeclaration,
|
||||
CreateStockLocationInput,
|
||||
FilterableStockLocationProps,
|
||||
FindConfig,
|
||||
IEventBusService,
|
||||
MODULE_RESOURCE_TYPE,
|
||||
setMetadata,
|
||||
StockLocationAddressInput,
|
||||
TransactionBaseService,
|
||||
UpdateStockLocationInput,
|
||||
} from "@medusajs/medusa"
|
||||
|
||||
import {
|
||||
ConfigurableModuleDeclaration,
|
||||
MODULE_RESOURCE_TYPE,
|
||||
} from "@medusajs/modules-sdk"
|
||||
|
||||
import { isDefined, MedusaError } from "medusa-core-utils"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
@@ -232,7 +236,7 @@ export default class StockLocationService extends TransactionBaseService {
|
||||
const locationAddressRepo = manager.getRepository(StockLocationAddress)
|
||||
|
||||
const existingAddress = await locationAddressRepo.findOne({
|
||||
where: { id: addressId }
|
||||
where: { id: addressId },
|
||||
})
|
||||
if (!existingAddress) {
|
||||
throw new MedusaError(
|
||||
|
||||
Reference in New Issue
Block a user