Use teamHubs API and update pnpm workspace
Switch CreateOrderDialog to the new team hubs API: replace useListHubs with useListTeamHubs, iterate hubsData.teamHubs, and show h.hubName in the Select. Also adjust pnpm configuration: add packages: ['.'] to pnpm-workspace.yaml and remove the overrides block from pnpm-lock.yaml (overrides moved into the workspace file). These changes align the UI with the updated dataconnect-generated API shape and correct the pnpm workspace setup.
This commit is contained in:
3
apps/web/pnpm-lock.yaml
generated
3
apps/web/pnpm-lock.yaml
generated
@@ -4,9 +4,6 @@ settings:
|
|||||||
autoInstallPeers: true
|
autoInstallPeers: true
|
||||||
excludeLinksFromLockfile: false
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
overrides:
|
|
||||||
'@dataconnect/generated': link:src/dataconnect-generated
|
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
|
|
||||||
.:
|
.:
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
|
packages:
|
||||||
|
- '.'
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
'@dataconnect/generated': link:src/dataconnect-generated
|
'@dataconnect/generated': link:src/dataconnect-generated
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@/common/components/ui/dialog";
|
} from "@/common/components/ui/dialog";
|
||||||
import EventFormWizard from "./EventFormWizard";
|
import EventFormWizard from "./EventFormWizard";
|
||||||
import { useCreateOrder, useListBusinesses, useListHubs } from "@/dataconnect-generated/react";
|
import { useCreateOrder, useListBusinesses, useListTeamHubs } from "@/dataconnect-generated/react";
|
||||||
import { OrderType, OrderStatus } from "@/dataconnect-generated";
|
import { OrderType, OrderStatus } from "@/dataconnect-generated";
|
||||||
import { dataConnect } from "@/features/auth/firebase";
|
import { dataConnect } from "@/features/auth/firebase";
|
||||||
import { useToast } from "@/common/components/ui/use-toast";
|
import { useToast } from "@/common/components/ui/use-toast";
|
||||||
@@ -26,7 +26,7 @@ export default function CreateOrderDialog({ open, onOpenChange }: CreateOrderDia
|
|||||||
const [selectedHubId, setSelectedHubId] = React.useState<string>("");
|
const [selectedHubId, setSelectedHubId] = React.useState<string>("");
|
||||||
|
|
||||||
const { data: businessesData } = useListBusinesses(dataConnect);
|
const { data: businessesData } = useListBusinesses(dataConnect);
|
||||||
const { data: hubsData } = useListHubs(dataConnect);
|
const { data: hubsData } = useListTeamHubs(dataConnect);
|
||||||
|
|
||||||
const createOrderMutation = useCreateOrder(dataConnect, {
|
const createOrderMutation = useCreateOrder(dataConnect, {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
@@ -109,9 +109,9 @@ export default function CreateOrderDialog({ open, onOpenChange }: CreateOrderDia
|
|||||||
<SelectValue placeholder="Select Hub" />
|
<SelectValue placeholder="Select Hub" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{hubsData?.hubs.map((h) => (
|
{hubsData?.teamHubs.map((h) => (
|
||||||
<SelectItem key={h.id} value={h.id}>
|
<SelectItem key={h.id} value={h.id}>
|
||||||
{h.name}
|
{h.hubName}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user