{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE IncoherentInstances #-}
module Gargantext.API.Node.File where
import Control.Lens ((^.))
import Gargantext.Database.Query.Table.Node.UpdateOpaleye (updateHyperdata)
import Gargantext.Database.Schema.Node (node_hyperdata)
import Gargantext.Prelude
+import Data.Either
data RESPONSE deriving Typeable
:> "download"
:> Get '[RESPONSE] (Headers '[Servant.Header "Content-Type" Text] BSResponse)
+instance MimeUnrender RESPONSE BSResponse where
+ mimeUnrender _ lbs = Right $ BSResponse (BSL.toStrict lbs)
+
fileApi :: UserId -> NodeId -> GargServer FileApi
fileApi uId nId = fileDownload uId nId