Allowed task reporting with zero completed tasks and hid the Report button if the reported date is not null.

This commit is contained in:
ashutosh.nehete 2025-05-10 18:20:57 +05:30
parent 5d5e33f308
commit 4ae42c4756
2 changed files with 1 additions and 2 deletions

View File

@ -19,7 +19,6 @@ export const ReportTask = ({ report, closeModal, refetch }) => {
.max(maxPending, {
message: `Completed task cannot exceed total pending tasks: ${maxPending}`,
})
.positive("Completed Work must be a positive number")
.optional(),
comment: z.string().min(1, "Comment cannot be empty"),
});

View File

@ -318,7 +318,7 @@ const DailyTask = () => {
<button
type="button"
className={`btn btn-xs btn-primary ${
task.completedTask > 0 ? "d-none" : ""
task.reportedDate != null ? "d-none" : ""
}`}
onClick={() => {
selectTask(task);