import Gargantext.Database.Query.Table.Node.Error (HasNodeError)
import Gargantext.Database.Schema.Node
import Gargantext.Prelude
-import qualified Gargantext.Prelude.Utils as GPU
+import qualified Gargantext.Database.GargDB as GargDB
------------------------------------------------------------------------
nt | nt == toDBid NodeUser -> panic "Not allowed to delete NodeUser (yet)"
nt | nt == toDBid NodeTeam -> do
uId <- getUserId u
- if _node_userId node' == uId
+ if _node_user_id node' == uId
then N.deleteNode nodeId
else delFolderTeam u nodeId
nt | nt == toDBid NodeFile -> do
node <- getNodeWith nodeId (Proxy :: Proxy HyperdataFile)
let (HyperdataFile { _hff_path = path }) = node ^. node_hyperdata
- GPU.removeFile $ unpack path
+ GargDB.rmFile $ unpack path
N.deleteNode nodeId
_ -> N.deleteNode nodeId
-- else if hasNodeType node' NodeTeam
-- then do
-- uId <- getUserId u
- -- if _node_userId node' == uId
+ -- if _node_user_id node' == uId
-- then N.deleteNode nodeId
-- else delFolderTeam u nodeId
-- else N.deleteNode nodeId