Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Amélie <[email protected]>
  • Loading branch information
bidoubiwa and alallema authored Feb 8, 2022
1 parent 214d102 commit ae7ad35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
9 changes: 4 additions & 5 deletions Sources/MeiliSearch/Indexes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public struct Indexes {
Get the index.

- parameter completion: The completion closure used to notify when the server
completes the query request, it returns a `Result` object that contains `Index`
value. If the request was sucessful or `Error` if a failure occured.
completes the query request. It returns a `Result` object that contains `Index`
value if the request was successful or `Error` if a failure occurred.
*/
public func get(_ completion: @escaping (Result<Index, Swift.Error>) -> Void) {
self.request.get(api: "/indexes/\(self.uid)") { result in
Expand Down Expand Up @@ -98,8 +98,8 @@ public struct Indexes {
List all indexes.

- parameter completion: The completion closure used to notify when the server
completes the query request, it returns a `Result` object that contains `[Index]`
value. If the request was sucessful or `Error` if a failure occured.
completes the query request. It returns a `Result` object that contains `[Index]`
value if the request was successful or `Error` if a failure occurred.
*/
public static func getAll(config: Config, _ completion: @escaping (Result<[Index], Swift.Error>) -> Void) {
Request(config).get(api: "/indexes") { result in
Expand Down Expand Up @@ -253,7 +253,6 @@ public struct Indexes {
} catch {
completion(.failure(error))
}
// }
case .failure(let error):
completion(.failure(error))
}
Expand Down
20 changes: 10 additions & 10 deletions Sources/MeiliSearch/Model/Task.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ public struct Task: Codable, Equatable {

// MARK: Properties

/// Unique ID for the current `Update`.
/// Unique ID for the current `Task`.
public let uid: Int

/// Unique ID for the current `Update`.
/// Unique ID for the current `Task`.
public let indexUid: String

/// Returns if the update has been sucessful or not.
/// Returns if the task has been successful or not.
public let status: Task.Status

/// Type of update.
/// Type of the task.
public let type: String

/// Type of update.
/// Details of the task.
public let details: Details?

/// Duration of the update process.
/// Duration of the task process.
public let duration: String?

/// Date when the update has been enqueued.
/// Date when the task has been enqueued.
public let enqueuedAt: String

/// Date when the update has been processed.
/// Date when the task has been processed.
// TODO: should this become a Date type?
public let processedAt: String?

/// Type of `Update`.
/// Type of `Task`.
public struct Details: Codable, Equatable {

// MARK: Properties
Expand Down Expand Up @@ -68,7 +68,7 @@ public struct Task: Codable, Equatable {
// Stop words on settings actions
public let stopWords: [String]?

// Stop words on settings actions
// Synonyms on settings actions
public let synonyms: [String: [String]]?

// Distinct attribute on settings actions
Expand Down

0 comments on commit ae7ad35

Please sign in to comment.