Skip to content

Commit 40ea18f

Browse files
Merge #603
603: GetTasks: allow for reverse param r=curquiza a=cosmastech # Pull Request ## Related issue Fixes #596 ## What does this PR do? - Allow passing "reverse" to the get tasks endpoint. ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Luke Kuzmish <[email protected]>
2 parents 55d3119 + 25cd056 commit 40ea18f

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

index_task.go

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ func (i *index) GetTasksWithContext(ctx context.Context, param *TasksQuery) (*Ta
5959
} else {
6060
req.withQueryParams["indexUids"] = i.uid
6161
}
62+
63+
if param.Reverse {
64+
req.withQueryParams["reverse"] = "true"
65+
}
6266
}
6367
if err := i.client.executeRequest(ctx, req); err != nil {
6468
return nil, err

index_task_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ func TestIndex_GetTasks(t *testing.T) {
153153
From: 1,
154154
Statuses: []TaskStatus{TaskStatusSucceeded},
155155
Types: []TaskType{TaskTypeDocumentAdditionOrUpdate},
156+
Reverse: true,
156157
},
157158
},
158159
},

types.go

+1
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ type TasksQuery struct {
283283
AfterStartedAt time.Time
284284
BeforeFinishedAt time.Time
285285
AfterFinishedAt time.Time
286+
Reverse bool
286287
}
287288

288289
// CancelTasksQuery is a list of filter available to send as query parameters

types_easyjson.go

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)