From 53f4ac36c8df041feb178767979a159f1c078c11 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Wed, 28 Feb 2018 15:40:34 +0100 Subject: [PATCH] fix handle --- src/core/handlers/RemoteHandler.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/handlers/RemoteHandler.coffee b/src/core/handlers/RemoteHandler.coffee index 9481505..34dae2e 100644 --- a/src/core/handlers/RemoteHandler.coffee +++ b/src/core/handlers/RemoteHandler.coffee @@ -72,17 +72,20 @@ self.OS.API.handler = _API.post p, d, c, () -> alert "Resource not found: #{p}" logout: () -> - p = "#{_REST}/system/logout" - _API.post p, {}, (d) -> + _API.handler.setting () -> + p = "#{_REST}/system/logout" + _API.post p, {}, (d) -> _OS.boot() , () -> alert "Resource not found #{p}" - setting: () -> + setting: (f) -> p = "#{_REST}/system/settings" _API.post p, _OS.setting, (d) -> _courrier.oserror "Cannot save system setting", d.error if d.error + f() if f , (e, s) -> _courrier.osfail "Fail to make request: #{p}", e, s + f() if f dbquery: (cmd, d, c) -> path = "#{_REST}/db/#{cmd}"