diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index f48c9c023..fc9c7e39e 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -446,6 +446,7 @@ SOGoAppointmentObject *co; SoSecurityManager *sm; WORequest *request; + unsigned int httpStatus; event = [self event]; co = [self clientObject]; @@ -515,16 +516,21 @@ } if (ex) - jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys: - @"failure", @"status", - [ex reason], - @"message", - nil]; + { + httpStatus = 500; + jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys: + @"failure", @"status", + [ex reason], @"message", + nil]; + } else - jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys: - @"success", @"status", nil]; + { + httpStatus = 200; + jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys: + @"success", @"status", nil]; + } - return [self responseWithStatus: 200 + return [self responseWithStatus: httpStatus andJSONRepresentation: jsonResponse]; }