Add next_due_date editing to admin task form
- Add NextDueDate field to UpdateTaskRequest DTO - Add handler logic to process next_due_date updates - Add next_due_date input field to task edit form - Update TypeScript models with next_due_date field 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -135,6 +135,7 @@ type UpdateTaskRequest struct {
|
||||
StatusID *uint `json:"status_id"`
|
||||
FrequencyID *uint `json:"frequency_id"`
|
||||
DueDate *string `json:"due_date"`
|
||||
NextDueDate *string `json:"next_due_date"`
|
||||
EstimatedCost *float64 `json:"estimated_cost"`
|
||||
ActualCost *float64 `json:"actual_cost"`
|
||||
ContractorID *uint `json:"contractor_id"`
|
||||
|
||||
@@ -221,6 +221,13 @@ func (h *AdminTaskHandler) Update(c *gin.Context) {
|
||||
updates["due_date"] = dueDate
|
||||
}
|
||||
}
|
||||
if req.NextDueDate != nil {
|
||||
if *req.NextDueDate == "" {
|
||||
updates["next_due_date"] = nil
|
||||
} else if nextDueDate, err := time.Parse("2006-01-02", *req.NextDueDate); err == nil {
|
||||
updates["next_due_date"] = nextDueDate
|
||||
}
|
||||
}
|
||||
if req.EstimatedCost != nil {
|
||||
updates["estimated_cost"] = decimal.NewFromFloat(*req.EstimatedCost)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user