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:
Riqwan Thamir
2023-07-27 16:42:26 +02:00
committed by GitHub
parent c85d479e52
commit 107ae23a3f
15 changed files with 25 additions and 15 deletions
+2 -1
View File
@@ -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,
},
},
+2 -2
View File
@@ -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 {}