Skip to content

Commit 40163ca

Browse files
author
Javier Segura
committed
fixing status
1 parent ccba872 commit 40163ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/MIOServerKit/RouterContext.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public struct ResponseContext {
6464

6565
func asJson ( ) -> [String:Any] {
6666
return [ "data": MIOCoreSerializableJSON( data )
67-
, "status": status.rawValue
67+
, "status": "OK"
6868
, "error": error
6969
, "errorCode": errorCode ]
7070
}
@@ -144,8 +144,8 @@ public protocol RouterContextProtocol {
144144
} else if let ret = json as? String {
145145
response.send( ret )
146146
} else {
147-
let response_json = json is [Any] || json is [String: Any] ? [ "status" : ResponseStatus.ok.rawValue, "data" : json! ]
148-
: [ "status" : ResponseStatus.ok.rawValue ]
147+
let response_json = json is [Any] || json is [String: Any] ? [ "status" : "OK", "data" : json! ]
148+
: [ "status" : "OK" ]
149149
#if SAVE_RECORD
150150
if record_request {
151151
g_request_recorder.append( RequestRecorded( self, response_json ) )
@@ -163,7 +163,7 @@ public protocol RouterContextProtocol {
163163

164164
response.status( httpStatus )
165165

166-
let response_json: [String:Any] = ["status" : ResponseStatus.error.rawValue, "error" : error.localizedDescription, "errorCode": error is MIOErrorCode ? (error as! MIOErrorCode).code : 0 ]
166+
let response_json: [String:Any] = ["status" : "Error", "error" : error.localizedDescription, "errorCode": error is MIOErrorCode ? (error as! MIOErrorCode).code : 0 ]
167167

168168
#if SAVE_RECORD
169169
if record_request {

0 commit comments

Comments
 (0)