From d93c6dadcad4356deea5127278b203c5f62c9196 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sun, 11 May 2025 15:22:27 -0600 Subject: [PATCH] refactor: Remove empty if block in handleUpdateTask --- main.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index 40594773aacd8e6b93b61533d02aa22aed636ebc..dc233ce64810478c0541a26d1aa9ac834daf0620 100644 --- a/main.go +++ b/main.go @@ -486,16 +486,14 @@ func handleUpdateTask( if goalIDArg, exists := arguments["goal_id"]; exists { if goalIDStr, ok := goalIDArg.(string); ok && goalIDStr != "" { updatePayload.GoalID = goalIDStr - if !areaIDProvided && specifiedArea == nil { - // If goal_id is specified, but area_id is not, we cannot validate the goal against a specific area from config. - // The API will have to handle this. For stricter local validation, one might require area_id here. - // For now, we proceed, assuming the API can handle it or the goal is in the task's current (unchanged) area. - // If area_id WAS provided, specifiedArea would be set. - // If area_id was NOT provided, we need to check all areas, or rely on API. - // Let's enforce that if goal_id is given, and area_id is also given, the goal must be in that area. - // If goal_id is given and area_id is NOT, we can't validate locally. - // The description for goal_id parameter hints at this. - } + // If goal_id is specified, but area_id is not, we cannot validate the goal against a specific area from config. + // The API will have to handle this. For stricter local validation, one might require area_id here. + // For now, we proceed, assuming the API can handle it or the goal is in the task's current (unchanged) area. + // If area_id WAS provided, specifiedArea would be set. + // If area_id was NOT provided, we need to check all areas, or rely on API. + // Let's enforce that if goal_id is given, and area_id is also given, the goal must be in that area. + // If goal_id is given and area_id is NOT, we can't validate locally. + // The description for goal_id parameter hints at this. if specifiedArea != nil { // Only validate goal if its intended area (new or existing) is known foundGoal := false for _, goal := range specifiedArea.Goals {