API.purs 528 Bytes
Newer Older
1 2
module Gargantext.Components.NgramsTable.API where

3
import Gargantext.Config.REST (AffRESTError)
4
import Gargantext.Routes as GR
5
import Gargantext.Sessions (Session, post)
6 7 8 9 10 11 12 13 14 15
import Gargantext.Types as GT

type UpdateNodeListParams =
  (
    listId :: Int
  , nodeId :: Int
  , nodeType :: GT.TabSubType GT.CTabNgramType
  , session :: Session
  )

16
updateNodeList :: Record UpdateNodeListParams -> AffRESTError Int
17 18
updateNodeList { listId, nodeId, nodeType, session } =
  post session (GR.RecomputeNgrams nodeType nodeId listId) {}