React Query Integration for Server State Sync in Clinet #245

Merged
admin merged 60 commits from react-query into main 2025-07-11 11:32:19 +00:00
Showing only changes of commit afac84dc9b - Show all commits

View File

@ -8,8 +8,10 @@ import { useSelector } from "react-redux";
const workAreaSchema = z.object({
id: z.string().optional(),
buildingId: z.string().min(1, "Building is required"),
floorId: z.string().min(1, "Floor is required"),
buildingId: z.string().refine((val) => val !== "0", {
message: "Building is required",
}),
floorId: z.string().refine((val)=>val !== "0",{message:"Floor is required"}),
areaName: z.string().min(3, "Work Area Name must be at least 3 characters"),
});
@ -183,8 +185,9 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
<p className="danger-text">{errors.areaName.message}</p>
)}
</div>
<div className="col-12 text-center">
</>
)}
<div className="col-12 text-center">
<button type="submit" className="btn btn-sm btn-primary me-3" disabled={isPending}>
{isPending ? "Please Wait.." : watchWorkAreaId === "0" ? "Add Work Area" : "Update Work Area"}
</button>
@ -192,8 +195,6 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
Cancel
</button>
</div>
</>
)}
</form>
);
};