feat: Allow retrieval of soft-deleted products (#723)

This commit is contained in:
Oliver Windall Juhl authored and GitHub committed 2021-11-10 22:23:56 +01:00
1 parent 6f4e128944
commit 1e50aee4fe
5 files changed
+111 -17

No files matched your search

@@ -1,5 +1,5 @@
import { MedusaError } from "medusa-core-utils"
import { In, FindOperator, Raw } from "typeorm"
import { FindOperator, In, Raw } from "typeorm"
/**
* Common functionality for Services
@@ -63,13 +63,17 @@ class BaseService {
return acc
}, {})
return where
}
const query = {
where: build(selector),
}
if ("deleted_at" in selector) {
query.withDeleted = true
}
if ("skip" in config) {
query.skip = config.skip