fix: Accept filters in softDelete + fulfillment location clean-up (#7198)
This commit is contained in:
@@ -12,11 +12,11 @@ import {
|
||||
SoftDeleteReturn,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
MapToConfig,
|
||||
isString,
|
||||
kebabCase,
|
||||
lowerCaseFirst,
|
||||
mapObjectTo,
|
||||
MapToConfig,
|
||||
pluralize,
|
||||
upperCaseFirst,
|
||||
} from "../common"
|
||||
|
||||
@@ -19,13 +19,13 @@ import {
|
||||
MedusaError,
|
||||
shouldForceTransaction,
|
||||
} from "../common"
|
||||
import { FreeTextSearchFilterKey } from "../dal"
|
||||
import { buildQuery } from "./build-query"
|
||||
import {
|
||||
InjectManager,
|
||||
InjectTransactionManager,
|
||||
MedusaContext,
|
||||
} from "./decorators"
|
||||
import { FreeTextSearchFilterKey } from "../dal"
|
||||
|
||||
type SelectorAndData = {
|
||||
selector: FilterQuery<any> | BaseFilterable<FilterQuery<any>>
|
||||
@@ -440,10 +440,17 @@ export function internalModuleServiceFactory<
|
||||
|
||||
@InjectTransactionManager(propertyRepositoryName)
|
||||
async softDelete(
|
||||
idsOrFilter: string[] | InternalFilterQuery,
|
||||
idsOrFilter:
|
||||
| string
|
||||
| string[]
|
||||
| InternalFilterQuery
|
||||
| InternalFilterQuery[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
): Promise<[TEntity[], Record<string, unknown[]>]> {
|
||||
if (Array.isArray(idsOrFilter) && !idsOrFilter.length) {
|
||||
if (
|
||||
(Array.isArray(idsOrFilter) && !idsOrFilter.length) ||
|
||||
(!Array.isArray(idsOrFilter) && !idsOrFilter)
|
||||
) {
|
||||
return [[], {}]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user