feat: add logo field to settings schema and update settings client to handle file uploads
feat: integrate dialog close context in vendor select field and CRUD dialog components feat: enhance vendor general info to format status using utility function feat: implement form dialog context for managing dialog close actions feat: add async select field dialog close context for better form handling fix: update form mutation hook to close dialog on successful submission feat: extend document print types to include expense and credit note feat: add settings update payload type to include logo and other fields feat: create employee attendance and work history pages with resource management feat: implement payment made and received detail pages with actions feat: add quick shortcuts component for easy navigation in the dashboard feat: create actions for payment made and received with print and delete options feat: implement dialog close context for better dialog management feat: add error parsing utility for improved error handling in API responses
This commit is contained in:
@@ -19,6 +19,7 @@ import { useQueryClient } from "@tanstack/react-query"
|
||||
import { APPOINTMENT_ROUTES } from "@garage/api"
|
||||
import { useFormDialog } from "@/shared/components/form-dialog"
|
||||
import { AppointmentForm } from "./appointment-form"
|
||||
import { formatEnum } from "@/shared/utils/formatters"
|
||||
|
||||
type AppointmentActionsProps = {
|
||||
appointmentId: string
|
||||
@@ -50,7 +51,7 @@ export function AppointmentActions({ appointmentId, currentStatus, jobCardId }:
|
||||
setIsLoading(true)
|
||||
try {
|
||||
await api.appointments.changeStatus(appointmentId, { status } as any)
|
||||
toast.success(`Status updated to "${status}".`)
|
||||
toast.success(`Status updated to "${formatEnum(status)}".`)
|
||||
queryClient.invalidateQueries({ queryKey: [APPOINTMENT_ROUTES.INDEX] })
|
||||
router.refresh()
|
||||
} catch {
|
||||
|
||||
@@ -15,6 +15,7 @@ import Link from "next/link"
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/shared/components/ui/card"
|
||||
import { Badge } from "@/shared/components/ui/badge"
|
||||
import { Button } from "@/shared/components/ui/button"
|
||||
import { formatEnum } from "@/shared/utils/formatters"
|
||||
|
||||
type AppointmentData = {
|
||||
id?: number
|
||||
@@ -89,7 +90,7 @@ export function AppointmentGeneralInfo({ appointment }: AppointmentGeneralInfoPr
|
||||
<div className="flex items-center gap-2">
|
||||
{appointment.status && (
|
||||
<Badge className={statusClass}>
|
||||
{appointment.status.replace("_", " ")}
|
||||
{formatEnum(appointment.status)}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user