fix(utils, types, medusa-plugin-meilisearch, medusa-plugin-algolia): move SoftDeletableFilterKey, variantKeys, indexTypes from types to utils (#4623)
* chore: move SoftDeletableKey from types to utils * chore: move variantkeys, indextypes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Context, DAL, RepositoryTransformOptions } from "@medusajs/types"
|
||||
import { SoftDeletableFilterKey } from "@medusajs/utils"
|
||||
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
||||
import {
|
||||
buildQuery,
|
||||
@@ -69,7 +70,7 @@ const mikroOrmUpdateDeletedAtRecursively = async <T extends object = any>(
|
||||
|
||||
const relationEntities = await collectionRelation.getItems({
|
||||
filters: {
|
||||
[DAL.SoftDeletableFilterKey]: {
|
||||
[SoftDeletableFilterKey]: {
|
||||
withDeleted: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// TODO: Should we create a mikro orm specific package for this and the base repository?
|
||||
|
||||
import { Filter } from "@mikro-orm/core"
|
||||
import { DAL } from "@medusajs/types"
|
||||
import { SoftDeletableFilterKey } from "@medusajs/utils"
|
||||
|
||||
interface FilterArguments {
|
||||
withDeleted?: boolean
|
||||
@@ -9,7 +9,7 @@ interface FilterArguments {
|
||||
|
||||
export const SoftDeletable = (): ClassDecorator => {
|
||||
return Filter({
|
||||
name: DAL.SoftDeletableFilterKey,
|
||||
name: SoftDeletableFilterKey,
|
||||
cond: ({ withDeleted }: FilterArguments = {}) => {
|
||||
if (withDeleted) {
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user