feat(admin-ui,medusa): Reservations management (#4081)
* add location filtering to list-location levels * cleanup * add location filtering to list-location levels * cleanup * Initial work on route,table,new reservation form * generated types * add block * udpate clients * initial create reservation * update actionables for reservation table * update edit-allocation modal * misc naming updates * update reservations table * add expand capabilities for list-reservations * expand fields and show columns * update oas * make remove item work in focus modal * add yarn lock * add integration test * Fix display when label doesn't match search term * remove unused file * Update packages/admin-ui/ui/src/components/templates/reservations-table/components/reservation-form/index.tsx Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> * Update packages/admin-ui/ui/src/domain/orders/details/allocations/edit-allocation-modal.tsx Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> * Update packages/admin-ui/ui/src/components/templates/reservations-table/new/index.tsx Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> * initial changes * add changeset * update font size * cleanup reservations table + select * add decorated inventory item type * use type * feedback changes * Update packages/admin-ui/ui/src/components/molecules/item-search/index.tsx Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * decorate response for list inventory item to include total quantities * update decorated properties * decorate type * adrien feedback * Update packages/generated/client-types/src/lib/models/DecoratedInventoryItemDTO.ts Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> * update join-utils * fix caching --------- Co-authored-by: Rares Capilnar <rares.capilnar@gmail.com> Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
import {
|
||||
AdminGetInventoryItemsItemLocationLevelsParams,
|
||||
AdminGetStockLocationsParams,
|
||||
AdminInventoryItemsListWithVariantsAndLocationLevelsRes,
|
||||
AdminInventoryItemsLocationLevelsRes,
|
||||
AdminInventoryItemsRes,
|
||||
} from "@medusajs/medusa"
|
||||
|
||||
import { Response } from "@medusajs/medusa-js"
|
||||
import { useQuery } from "@tanstack/react-query"
|
||||
import { useMedusa } from "../../../contexts"
|
||||
import { UseQueryOptionsWrapper } from "../../../types"
|
||||
import { queryKeysFactory } from "../../utils"
|
||||
import { useMedusa } from "../../../contexts"
|
||||
import { useQuery } from "@tanstack/react-query"
|
||||
|
||||
const ADMIN_INVENTORY_ITEMS_QUERY_KEY = `admin_inventory_items` as const
|
||||
|
||||
@@ -59,7 +61,7 @@ export const useAdminInventoryItem = (
|
||||
|
||||
export const useAdminInventoryItemLocationLevels = (
|
||||
inventoryItemId: string,
|
||||
query?: AdminGetStockLocationsParams,
|
||||
query?: AdminGetInventoryItemsItemLocationLevelsParams,
|
||||
options?: UseQueryOptionsWrapper<
|
||||
Response<AdminInventoryItemsLocationLevelsRes>,
|
||||
Error,
|
||||
|
||||
@@ -11,10 +11,11 @@ import {
|
||||
} from "@tanstack/react-query"
|
||||
|
||||
import { Response } from "@medusajs/medusa-js/src"
|
||||
import { adminInventoryItemsKeys } from "../inventory-item"
|
||||
import { adminReservationsKeys } from "./queries"
|
||||
import { adminVariantKeys } from "../variants"
|
||||
import { buildOptions } from "../../utils/buildOptions"
|
||||
import { useMedusa } from "../../../contexts"
|
||||
import { adminVariantKeys } from "../variants"
|
||||
|
||||
export const useAdminCreateReservation = (
|
||||
options?: UseMutationOptions<
|
||||
@@ -57,6 +58,7 @@ export const useAdminUpdateReservation = (
|
||||
adminReservationsKeys.lists(),
|
||||
adminReservationsKeys.detail(id),
|
||||
adminVariantKeys.all,
|
||||
adminInventoryItemsKeys.details()
|
||||
],
|
||||
options
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user