Simplified the way response objects are written with the 200 - OK response

This commit is contained in:
Kenneth Skovhede
2014-07-02 15:03:56 +02:00
parent 2bad7b01cb
commit 65ee7d7846
9 changed files with 51 additions and 50 deletions
@@ -62,7 +62,7 @@ namespace Duplicati.Server.WebServer
throw new InvalidDataException("External is temporary but internal is not?");
Program.DataConnection.UpdateTemporaryBackup(backup);
bw.WriteJsonObject(new { status = "OK" });
bw.OutputOK();
}
else
{
@@ -86,7 +86,7 @@ namespace Duplicati.Server.WebServer
}
bw.WriteJsonObject(new { status = "OK" });
bw.OutputOK();
}
}
catch (Exception ex)
@@ -124,7 +124,7 @@ namespace Duplicati.Server.WebServer
{
Program.DataConnection.RegisterTemporaryBackup(data.Backup);
bw.WriteJsonObject(new { status = "OK", ID = data.Backup.ID });
bw.OutputOK(new { status = "OK", ID = data.Backup.ID });
}
else
{
@@ -139,7 +139,7 @@ namespace Duplicati.Server.WebServer
Program.DataConnection.AddOrUpdateBackupAndSchedule(data.Backup, data.Schedule);
}
bw.WriteJsonObject(new { status = "OK", ID = data.Backup.ID });
bw.OutputOK(new { status = "OK", ID = data.Backup.ID });
}
}
catch (Exception ex)