From 421f7e8b6c8de06dfff87e513e203e5a451a7c31 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Mon, 19 Feb 2018 22:11:04 +0100 Subject: [PATCH] allow unshare file --- src/core/handlers/RemoteHandler.coffee | 5 +++-- src/core/vfs.coffee | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/handlers/RemoteHandler.coffee b/src/core/handlers/RemoteHandler.coffee index c03092e..6a2b7cc 100644 --- a/src/core/handlers/RemoteHandler.coffee +++ b/src/core/handlers/RemoteHandler.coffee @@ -15,10 +15,11 @@ self.OS.API.handler = path = "#{_REST}/fs/mkdir" _API.post path, { path: p }, c, (e, s) -> _courrier.osfail "Fail to create directory: #{p}", e, s - sharefile: (p, c) -> + sharefile: (p, pub , c) -> path = "#{_REST}/fs/publish" - _API.post path, { path: p }, c, (e, s) -> + _API.post path, { path: p , publish: pub }, c, (e, s) -> _courrier.osfail "Fail to publish file: #{p}", e, s + fileinfo: (p, c) -> path = "#{_REST}/fs/fileinfo" _API.post path, { path: p }, c, (e, s) -> diff --git a/src/core/vfs.coffee b/src/core/vfs.coffee index 74f5c3b..1a99f5f 100644 --- a/src/core/vfs.coffee +++ b/src/core/vfs.coffee @@ -147,7 +147,7 @@ class RemoteFileHandler extends self.OS.API.VFS.BaseFileHandler when "remove" _API.handler.delete @path, f when "publish" - _API.handler.sharefile @path, f + _API.handler.sharefile @path, true , f when "download" return if @info.type is "dir" _API.handler.fileblob @path, (d) -> @@ -274,7 +274,7 @@ class SharedFileHandler extends self.OS.API.VFS.BaseFileHandler _API.handler.write @path, p, f when "remove" - _API.handler.delete @path, f + _API.handler.sharefile @basename, false, f when "upload" return