fix(): handle empty q filters - allow to query deleted records from graph API - staled_at fixes (#11544)
* fix(): Allow to query deleted records from graph API * fix(): Allow to query deleted records from graph API * handle empty q value * update staled at sync * rename integration tests file * Create strong-houses-marry.md * try to fix flacky tests * fix pricing context * update changeset * update changeset * fix import * skip test for now --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
co-authored by
Oli Juhl
parent
cfffd55ae6
commit
065df75e7d
@@ -7,17 +7,18 @@ import {
|
||||
TaxCalculationContext,
|
||||
} from "@medusajs/framework/types"
|
||||
import { calculateAmountsWithTax, Modules } from "@medusajs/framework/utils"
|
||||
import { TaxModuleService } from "@medusajs/tax/dist/services"
|
||||
|
||||
export type RequestWithContext<Body, QueryFields = Record<string, unknown>> =
|
||||
MedusaStoreRequest<Body, QueryFields> & {
|
||||
taxContext: {
|
||||
taxLineContext?: TaxCalculationContext
|
||||
taxInclusivityContext?: {
|
||||
automaticTaxes: boolean
|
||||
}
|
||||
export type RequestWithContext<
|
||||
Body,
|
||||
QueryFields = Record<string, unknown>
|
||||
> = MedusaStoreRequest<Body, QueryFields> & {
|
||||
taxContext: {
|
||||
taxLineContext?: TaxCalculationContext
|
||||
taxInclusivityContext?: {
|
||||
automaticTaxes: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const refetchProduct = async (
|
||||
idOrFilter: string | object,
|
||||
@@ -44,7 +45,7 @@ export const wrapProductsWithTaxPrices = async <T>(
|
||||
return
|
||||
}
|
||||
|
||||
const taxService = req.scope.resolve<TaxModuleService>(Modules.TAX)
|
||||
const taxService = req.scope.resolve(Modules.TAX)
|
||||
|
||||
const taxRates = (await taxService.getTaxLines(
|
||||
products.map(asTaxItem).flat(),
|
||||
|
||||
@@ -49,7 +49,7 @@ async function getProductsWithIndexEngine(
|
||||
|
||||
if (isPresent(req.pricingContext)) {
|
||||
context["variants"] ??= {}
|
||||
context["variants.calculated_price"] = QueryContext(req.pricingContext!)
|
||||
context["variants"]["calculated_price"] = QueryContext(req.pricingContext!)
|
||||
}
|
||||
|
||||
const filters: Record<string, any> = req.filterableFields
|
||||
|
||||
Reference in New Issue
Block a user