Add method to create a “success” JSON object.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / GetSoneStatusPage.java
index ff8e181..13ed15e 100644 (file)
@@ -57,7 +57,7 @@ public class GetSoneStatusPage extends JsonPage {
                String soneId = request.getHttpRequest().getParam("sone");
                Sone sone = webInterface.getCore().getSone(soneId);
                SoneStatus soneStatus = webInterface.getCore().getSoneStatus(sone);
-               return new JsonObject().put("status", soneStatus.name()).put("name", SoneAccessor.getNiceName(sone)).put("modified", webInterface.getCore().isModifiedSone(sone)).put("lastUpdated", new SimpleDateFormat("MMM d, yyyy, HH:mm:ss").format(new Date(sone.getTime()))).put("age", (System.currentTimeMillis() - sone.getTime()) / 1000);
+               return createSuccessJsonObject().put("status", soneStatus.name()).put("name", SoneAccessor.getNiceName(sone)).put("modified", webInterface.getCore().isModifiedSone(sone)).put("lastUpdated", new SimpleDateFormat("MMM d, yyyy, HH:mm:ss").format(new Date(sone.getTime()))).put("age", (System.currentTimeMillis() - sone.getTime()) / 1000);
        }
 
        /**