Skip to content

Commit

Permalink
Fix status page values (support strings and ints)
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecNew10 committed Apr 6, 2023
1 parent 614feb5 commit 64a3ec2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion appdb/Models/ServiceStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ struct ServiceStatus: Mappable {
var name: String = ""
var isOnline = false
var data: String?
var dataInt: Int?
var dataString: String?

mutating func mapping(map: Map) {
name <- map["name"]
isOnline <- map["is_online"]
data <- map["data"]
dataInt <- map["data"]
dataString <- map["data"]
if (dataInt != nil) {
data = String(dataInt!)
}
if (dataString != nil) {
data = dataString
}
}
}

0 comments on commit 64a3ec2

Please sign in to comment.