fix(calendar): do not transmit og http status to external calendar

This commit is contained in:
Hivert Quentin
2026-06-09 10:26:58 +02:00
parent f11f34cdef
commit 3a78a3bbb4
2 changed files with 18 additions and 2 deletions
+14 -2
View File
@@ -148,14 +148,26 @@
*/
- (WOResponse *) reloadAction
{
NSDictionary *results;
NSMutableDictionary *results;
NSString *error;
unsigned int httpCode;
httpCode = 200;
results = [[self clientObject] loadWebCalendar];
if ([results objectForKey: @"status"])
httpCode = [[results objectForKey: @"status"] intValue];
{
if ([results objectForKey: @"error"])
{
error = [results objectForKey: @"error"];
if ([error isEqualToString: @"need-auth"])
httpCode = 401;
if ([error isEqualToString: @"invalid-calendar-content"] || [error isEqualToString: @"http-error"])
httpCode = 500;
}
[results removeObjectForKey:@"status"];
}
return [self responseWithStatus: httpCode andJSONRepresentation: results];
}