Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Version numbers follow [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Fixed
- `task create/update --not-all-day` now sends `isAllDay` to the Web API.

## [v0.2.7] - 2026-07-18

### Added
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ func TestTaskCreateDryRunJSON(t *testing.T) {
if items := task["items"].([]any); len(items) != 1 {
t.Fatalf("items len = %d, want 1", len(items))
}
if task["allDay"] != true {
t.Fatalf("allDay = %v, want true", task["allDay"])
if task["isAllDay"] != true {
t.Fatalf("isAllDay = %v, want true", task["isAllDay"])
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/webapi/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type TaskMutation struct {
Title string `json:"title,omitempty"`
Content string `json:"content,omitempty"`
Desc string `json:"desc,omitempty"`
AllDay *bool `json:"allDay,omitempty"`
AllDay *bool `json:"isAllDay,omitempty"`
StartDate string `json:"startDate,omitempty"`
DueDate string `json:"dueDate,omitempty"`
TimeZone string `json:"timeZone,omitempty"`
Expand Down
26 changes: 26 additions & 0 deletions internal/webapi/tasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,32 @@ func TestTaskUpdateCanSendPriorityZero(t *testing.T) {
}
}

func TestTaskUpdateCanSendAllDayFalse(t *testing.T) {
var rawBody string
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
data, err := io.ReadAll(r.Body)
if err != nil {
t.Fatalf("read request: %v", err)
}
rawBody = string(data)
_ = json.NewEncoder(w).Encode(map[string]any{"ok": true})
}))
defer server.Close()

client := NewClient("test-token")
client.BaseURL = server.URL
allDay := false
if _, err := client.UpdateTask(context.Background(), TaskMutation{ID: "t1", ProjectID: "p1", AllDay: &allDay}); err != nil {
t.Fatalf("UpdateTask() error = %v", err)
}
if !strings.Contains(rawBody, `"isAllDay":false`) {
t.Fatalf("request body missing isAllDay false: %s", rawBody)
}
if strings.Contains(rawBody, `"allDay"`) {
t.Fatalf("request body contains legacy allDay key: %s", rawBody)
}
}

func TestProjectTasksUsesProjectEndpoint(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if got := r.Method + " " + r.URL.Path; got != "GET /project/p1/tasks" {
Expand Down