fix(admin-ui): Fix use of expand parameter on order page (#3383)

* Create cuddly-seahorses-thank.md

* add integration tests

* revert back from master to develop

* fix expand

* add new integration test

* add missing default relations

* add missing refunds relation

* re work

* fix tests

* init

* fix order page according to fixes to expand

* expand shipping on returns

* Create .changeset/cuddly-beers-tease.md

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Kasper Fabricius Kristensen
2023-03-07 19:43:44 +01:00
committed by GitHub
parent 47d3440766
commit d0d11307d2
10 changed files with 54 additions and 35 deletions
@@ -13,7 +13,7 @@ import {
useAdminOrderEdits,
} from "medusa-react"
import { useMemo } from "react"
import { orderReturnableFields } from "../domain/orders/details/utils/order-returnable-fields"
import useOrdersExpandParam from "../domain/orders/details/utils/use-admin-expand-paramter"
import { useFeatureFlag } from "../providers/feature-flag-provider"
export interface TimelineEvent {
@@ -157,8 +157,10 @@ export interface NotificationEvent extends TimelineEvent {
}
export const useBuildTimeline = (orderId: string) => {
const { orderRelations } = useOrdersExpandParam()
const { order, refetch } = useAdminOrder(orderId, {
fields: orderReturnableFields,
expand: orderRelations,
})
const { order_edits: edits } = useAdminOrderEdits({ order_id: orderId })