Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
132
Issues
132
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
c53aac5c
Verified
Commit
c53aac5c
authored
Sep 28, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor] some small refactoring of G.C.D.API function
parent
6cf1f270
Pipeline
#4635
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
API.purs
src/Gargantext/Components/Document/API.purs
+11
-4
Types.purs
src/Gargantext/Components/Document/Types.purs
+7
-0
No files found.
src/Gargantext/Components/Document/API.purs
View file @
c53aac5c
...
...
@@ -6,13 +6,16 @@ import Gargantext.Prelude
import Data.Either (Either(..))
import Data.Maybe (Maybe(..))
import Gargantext.Components.Document.Types (DocPath, LoadedData, NodeDocument)
import Gargantext.Core.NgramsTable.Functions (loadNgramsTable)
import Gargantext.Components.Document.Types (DocPath, NgramsPath, LoadedData, NodeDocument)
import Gargantext.Core.NgramsTable.Functions as NTFunctions
import Gargantext.Core.NgramsTable.Types (VersionedNgramsTable)
import Gargantext.Components.Search (SearchType(..))
import Gargantext.Config.REST (AffRESTError)
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get)
import Gargantext.Types (NodeType(..), ScoreType(..))
loadDocument :: Session -> Int -> AffRESTError NodeDocument
loadDocument session nodeId = get session $ NodeAPI Context (Just nodeId) ""
...
...
@@ -22,7 +25,12 @@ loadData { listIds, nodeId, session, tabType } = do
case eDocument of
Left err -> pure $ Left err
Right document -> do
eNgramsTable <- loadNgramsTable
eNgramsTable <- loadNgramsTable { listIds, nodeId, session, tabType }
pure $ (\ngramsTable -> { document, ngramsTable }) <$> eNgramsTable
loadNgramsTable :: NgramsPath -> AffRESTError VersionedNgramsTable
loadNgramsTable { listIds, nodeId, session, tabType } =
NTFunctions.loadNgramsTable
{ listIds
, nodeId
, params: { offset : 0, limit : 100, orderBy: Nothing, searchType: SearchDoc}
...
...
@@ -33,4 +41,3 @@ loadData { listIds, nodeId, session, tabType } = do
, termListFilter: Nothing
, termSizeFilter: Nothing
}
pure $ (\ngramsTable -> { document, ngramsTable }) <$> eNgramsTable
src/Gargantext/Components/Document/Types.purs
View file @
c53aac5c
...
...
@@ -20,6 +20,13 @@ type DocPath = {
, tabType :: TabType
}
type NgramsPath = {
listIds :: Array ListId
, nodeId :: NodeID
, session :: Session
, tabType :: TabType
}
type NodeDocument = NodePoly Document
type LoadedData =
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment