Fix iOS list response decoding to match plain-array backend responses
GET /clients and GET /projects return bare arrays, not wrapped objects. Remove ClientListResponse and ProjectListResponse wrapper structs and update ClientsViewModel, ProjectsViewModel, and TimerViewModel to decode [Client] and [Project] directly.
This commit is contained in:
@@ -8,10 +8,6 @@ struct Client: Codable, Identifiable, Equatable, Hashable {
|
||||
let updatedAt: String
|
||||
}
|
||||
|
||||
struct ClientListResponse: Codable {
|
||||
let clients: [Client]
|
||||
}
|
||||
|
||||
struct CreateClientInput: Codable {
|
||||
let name: String
|
||||
let description: String?
|
||||
|
||||
@@ -16,10 +16,6 @@ struct ClientReference: Codable, Equatable, Hashable {
|
||||
let name: String
|
||||
}
|
||||
|
||||
struct ProjectListResponse: Codable {
|
||||
let projects: [Project]
|
||||
}
|
||||
|
||||
struct CreateProjectInput: Codable {
|
||||
let name: String
|
||||
let description: String?
|
||||
|
||||
Reference in New Issue
Block a user