Skip to content
Closed
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
15 changes: 14 additions & 1 deletion Sources/MeiliSearch/Model/Task.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,20 @@ public struct Task: Codable, Equatable {
public let status: Task.Status

/// Type of the task.
public let type: String
//public let type: String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove this comment.

public enum Type:Codable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there is some GithubAction annotations, please fix them:

image

case indexCreation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is not following the guidelines of the project. Also, you can move this enum to the bottom of the file but still inside of the scope of the public struct Task.

Type is a protected word in Swift, so you can use TaskType instead.

case indexUpdate
case indexDeletion
case indexSwap
case documentAdditionOrUpdate
case documentDeletion
case settingsUpdate
case dumpCreation
case taskCancelation
case taskDeletion
case snapshotCreation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still have to fix these typing errors to make your tests pass:

image

Example, from this:

XCTAssertEqual("indexCreation", task.type)
to this:
XCTAssertEqual(Task.TaskType.indexCreation, task.type)

}

/// Details of the task.
public let details: Details?
Expand Down