finish bills , po , jobcards relational fields creation

This commit is contained in:
2026-04-13 18:48:15 +03:00
parent 3eb471a604
commit 020ffccfd6
41 changed files with 11973 additions and 467 deletions
@@ -6,7 +6,7 @@ import { useQuery } from "@tanstack/react-query"
import { RefreshCw } from "lucide-react"
import { useAuthApi } from "@/shared/useApi"
import { AUTO_GENERATE_ROUTES } from "@garage/api"
import { AUTO_GENERATE_ROUTES, Tables } from "@garage/api"
import { FieldShell } from "../field-shell"
import { Input } from "@/shared/components/ui/input"
import { Button } from "@/shared/components/ui/button"
@@ -21,7 +21,7 @@ type RhfAutoGenerateFieldProps<
required?: boolean
disabled?: boolean
placeholder?: string
table: string
table: Tables
/** When true, fetches the next code immediately on mount */
autoFetch?: boolean
}
@@ -3,6 +3,7 @@
import type { FieldValues } from "react-hook-form"
import { FormProvider } from "react-hook-form"
import type { RhformProps } from "./types"
import { cn } from "@/shared/lib/utils"
export function Rhform<TValues extends FieldValues>({
form,
@@ -15,7 +16,7 @@ export function Rhform<TValues extends FieldValues>({
<form
onSubmit={(e) => { e.stopPropagation(); form.handleSubmit(onSubmit)(e) }}
noValidate
className={className}
className={cn('p-1',className)}
>
{children}
</form>