Skip to content

Commit

Permalink
fix: models
Browse files Browse the repository at this point in the history
  • Loading branch information
bigearsenal committed Jan 26, 2024
1 parent 2228a4d commit 08589cb
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ struct DeleteDeviceTokenDto: Encodable {
let clientId: String
let ethPubkey: String?
let type = "device"

enum CodingKeys: String, CodingKey {
case deviceToken = "device_token"
case clientId = "client_id"
case ethPubkey = "eth_pubkey"
case type
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ struct DeviceTokenDto: Encodable {
let ethPubkey: String?
let type = "device"
let deviceInfo: DeviceTokenInfo?

enum CodingKeys: String, CodingKey {
case deviceToken = "device_token"
case clientId = "client_id"
case ethPubkey = "eth_pubkey"
case type
case deviceInfo = "device_info"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ struct DeviceTokenInfo: Codable {
let osName: String
let osVersion: String
let deviceModel: String

enum CodingKeys: String, CodingKey {
case osName = "os_name"
case osVersion = "os_version"
case deviceModel = "device_model"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ struct DeviceTokenResponseDto: Decodable {
let deviceToken: String
let timestamp: String
let clientId: String

enum CodingKeys: String, CodingKey {
case deviceToken = "device_token"
case timestamp
case clientId = "client_id"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class NotificationRepositoryImpl: NotificationRepository {
header: header,
body: .init(
method: "add_device",
params: model
params: [model]
)
)
} catch let error as JSONRPCError<EmptyData> {
Expand All @@ -53,7 +53,7 @@ final class NotificationRepositoryImpl: NotificationRepository {
header: header,
body: .init(
method: "delete_device",
params: model
params: [model]
)
)
}
Expand Down

0 comments on commit 08589cb

Please sign in to comment.