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.
20 lines
381 B
Swift
20 lines
381 B
Swift
import Foundation
|
|
|
|
struct Client: Codable, Identifiable, Equatable, Hashable {
|
|
let id: String
|
|
let name: String
|
|
let description: String?
|
|
let createdAt: String
|
|
let updatedAt: String
|
|
}
|
|
|
|
struct CreateClientInput: Codable {
|
|
let name: String
|
|
let description: String?
|
|
}
|
|
|
|
struct UpdateClientInput: Codable {
|
|
let name: String?
|
|
let description: String?
|
|
}
|