Fix(medusa, inventory, stock-location, types, utils): Modules sdk build query (#5713)

* remove defaults

* take 2

* works now

* add changeset

* pricing module and pricing service list take null updates

* update handlers

* update product module service with take:null where relevant

* no spread

* note to self:default offset should be 0, not 15
This commit is contained in:
Philip Korsholm authored and GitHub committed 2023-11-27 10:17:42 +00:00
1 parent faa528159d
commit 18afe0b9ad
19 files changed
+103 -45

No files matched your search

+3
View File
@@ -206,6 +206,7 @@ class PricingService extends TransactionBaseService {
) {
const variables = {
variant_id: variantPriceData.map((pricedata) => pricedata.variantId),
take: null,
}
const query = {
@@ -685,6 +686,7 @@ class PricingService extends TransactionBaseService {
): Promise<Map<string, MoneyAmount[]>> {
const variables = {
variant_id: variantIds,
take: null,
}
const query = {
@@ -713,6 +715,7 @@ class PricingService extends TransactionBaseService {
price_set_id: priceSetIds,
},
{
take: null,
relations: [
"money_amount",
"price_list",
+2 -2
View File
@@ -48,11 +48,11 @@ export function buildQuery<TWhereKeys extends object, TEntity = unknown>(
}
if ("skip" in config) {
;(query as FindManyOptions<TEntity>).skip = config.skip
;(query as FindManyOptions<TEntity>).skip = config.skip ?? undefined
}
if ("take" in config) {
;(query as FindManyOptions<TEntity>).take = config.take
;(query as FindManyOptions<TEntity>).take = config.take ?? undefined
}
if (config.relations) {