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 committed by Vikas Nale
parent f6ab824529
commit f26b708564
2 changed files with 1 additions and 2 deletions

View File

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

View File

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