Commit e5bb3ecc authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[document export] add garg version

parent 1f68e162
...@@ -11,12 +11,15 @@ Portability : POSIX ...@@ -11,12 +11,15 @@ Portability : POSIX
module Gargantext.API.Node.Document.Export module Gargantext.API.Node.Document.Export
where where
import qualified Data.Text as T
import Data.Version (showVersion)
import Gargantext.API.Node.Document.Export.Types import Gargantext.API.Node.Document.Export.Types
import Gargantext.API.Prelude (GargNoServer) import Gargantext.API.Prelude (GargNoServer)
import Gargantext.Core.Types import Gargantext.Core.Types
-- import Gargantext.Database.Admin.Types.Hyperdata (HyperdataDocument(..)) -- import Gargantext.Database.Admin.Types.Hyperdata (HyperdataDocument(..))
import Gargantext.Database.Query.Table.Node (getDocumentsWithParentId) import Gargantext.Database.Query.Table.Node (getDocumentsWithParentId)
import Gargantext.Prelude import Gargantext.Prelude
import qualified Paths_gargantext as PG -- cabal magic build module
-- import Servant (Proxy(..)) -- import Servant (Proxy(..))
-------------------------------------------------- --------------------------------------------------
...@@ -28,7 +31,7 @@ getDocuments pId = do ...@@ -28,7 +31,7 @@ getDocuments pId = do
docs <- getDocumentsWithParentId pId -- NodeDocument (Proxy :: Proxy HyperdataDocument) docs <- getDocumentsWithParentId pId -- NodeDocument (Proxy :: Proxy HyperdataDocument)
printDebug "[getDocuments] got docs" docs printDebug "[getDocuments] got docs" docs
pure $ DocumentExport { _de_documents = mapDoc <$> docs pure $ DocumentExport { _de_documents = mapDoc <$> docs
, _de_garg_version = "" } , _de_garg_version = T.pack $ showVersion PG.version }
where where
mapDoc d = Document { _d_document = d mapDoc d = Document { _d_document = d
, _d_ngrams = Ngrams { _ng_ngrams = [] , _d_ngrams = Ngrams { _ng_ngrams = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment