refactor: migrated of the customer hooks for warehouse data fetching

This commit is contained in:
Nathnael
2026-06-22 12:25:20 +00:00
parent 74e03f2067
commit d66ccc5363
29 changed files with 336 additions and 704 deletions

View File

@@ -2,8 +2,10 @@ import { useEffect, useState } from 'react';
import { Alert, Button, Group, Modal, Stack, Text, TextInput } from '@mantine/core';
import { Info } from 'lucide-react';
import { useMutation } from '@tanstack/react-query';
import { api } from '@/services/api';
import { useToast } from '@/hooks/use-toast';
import { useReleaseInventory } from '@/hooks/useWarehouses';
import type { WarehouseInventoryItem } from '@/types/warehouse';
import { extractErrorMessage } from './options';
@@ -15,7 +17,7 @@ interface ReleaseOrderModalProps {
export function ReleaseOrderModal({ opened, onClose, item }: ReleaseOrderModalProps) {
const { toast } = useToast();
const releaseMutation = useReleaseInventory();
const releaseMutation = useMutation(api.warehouses.release.mutationOptions());
const [reference, setReference] = useState('');
useEffect(() => {