Skip to content

Commit b9435e5

Browse files
authored
Merge pull request #314 from meilisearch/indexes-changes
Indexes changes
2 parents c76c37c + e5e5513 commit b9435e5

File tree

7 files changed

+199
-96
lines changed

7 files changed

+199
-96
lines changed

Sources/MeiliSearch/Client.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public struct MeiliSearch {
6767
public func createIndex(
6868
uid: String,
6969
primaryKey: String? = nil,
70-
_ completion: @escaping (Result<Task, Swift.Error>) -> Void) {
70+
_ completion: @escaping (Result<TaskInfo, Swift.Error>) -> Void) {
7171
Indexes.create(uid: uid, primaryKey: primaryKey, config: self.config, completion)
7272
}
7373

@@ -93,8 +93,9 @@ public struct MeiliSearch {
9393
value. If the request was sucessful or `Error` if a failure occured.
9494
*/
9595
public func getIndexes(
96-
_ completion: @escaping (Result<[Index], Swift.Error>) -> Void) {
97-
Indexes.getAll(config: self.config, completion)
96+
params: IndexesQuery? = nil,
97+
_ completion: @escaping (Result<Results<Index>, Swift.Error>) -> Void) {
98+
Indexes.getAll(config: self.config, params: params, completion)
9899
}
99100

100101
/**
@@ -109,7 +110,7 @@ public struct MeiliSearch {
109110
public func updateIndex(
110111
uid: String,
111112
primaryKey: String,
112-
_ completion: @escaping (Result<Task, Swift.Error>) -> Void) {
113+
_ completion: @escaping (Result<TaskInfo, Swift.Error>) -> Void) {
113114
self.index(uid).update(primaryKey: primaryKey, completion)
114115
}
115116

@@ -123,7 +124,7 @@ public struct MeiliSearch {
123124
*/
124125
public func deleteIndex(
125126
_ uid: String,
126-
_ completion: @escaping (Result<Task, Swift.Error>) -> Void) {
127+
_ completion: @escaping (Result<TaskInfo, Swift.Error>) -> Void) {
127128
self.index(uid).delete(completion)
128129
}
129130

0 commit comments

Comments
 (0)