feat(dashboard): Update v2 store domain to follow conventions, and abstract some logic (#6927)
**What** - Updates the V2 store domain. - Abstracts some of the API requests logic into re-usable hooks **Note** - Partial PR as we need to add support for setting a default currency, region and location. Currently the `q` param is missing on all V2 endpoints, so we can't use our combobox component to list these options. Will be added later when that has been fixed in core. - The PR includes a generic hook for fetching combobox data, that I added before realising that `q` is not currently supported. But keeping it as it will be useful once support is added.
This commit is contained in:
@@ -5,10 +5,9 @@ import { SettingsLayout } from "../../components/layout/settings-layout"
|
||||
import { Outlet } from "react-router-dom"
|
||||
|
||||
import { Spinner } from "@medusajs/icons"
|
||||
import { SalesChannelDTO, UserDTO } from "@medusajs/types"
|
||||
import { ErrorBoundary } from "../../components/error/error-boundary"
|
||||
import { useV2Session } from "../../lib/api-v2"
|
||||
import { SalesChannelDTO } from "@medusajs/types"
|
||||
import { UserDTO } from "@medusajs/types"
|
||||
import { SearchProvider } from "../search-provider"
|
||||
import { SidebarProvider } from "../sidebar-provider"
|
||||
|
||||
@@ -135,7 +134,7 @@ export const v2Routes: RouteObject[] = [
|
||||
lazy: () => import("../../v2-routes/store/store-edit"),
|
||||
},
|
||||
{
|
||||
path: "add-currencies",
|
||||
path: "currencies",
|
||||
lazy: () =>
|
||||
import("../../v2-routes/store/store-add-currencies"),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user