Fix type errors

parent 1a3ab28f
...@@ -84,7 +84,7 @@ import qualified Gargantext.Database.Schema.Ngrams as Ngrams ...@@ -84,7 +84,7 @@ import qualified Gargantext.Database.Schema.Ngrams as Ngrams
-- import Gargantext.Database.Schema.NodeNgram hiding (Action) -- import Gargantext.Database.Schema.NodeNgram hiding (Action)
import Gargantext.Prelude import Gargantext.Prelude
-- import Gargantext.Core.Types (ListTypeId, listTypeId) -- import Gargantext.Core.Types (ListTypeId, listTypeId)
import Gargantext.Core.Types (ListType(..), NodeId, ListId, CorpusId, DocId, Limit, Offset, HasInvalidError, assertValid) import Gargantext.Core.Types (ListType(..), NodeId, ListId, DocId, Limit, Offset, HasInvalidError, assertValid)
import Servant hiding (Patch) import Servant hiding (Patch)
import System.FileLock (FileLock) import System.FileLock (FileLock)
import Test.QuickCheck (elements) import Test.QuickCheck (elements)
...@@ -787,15 +787,16 @@ putListNgrams listId ngramsType nes = do ...@@ -787,15 +787,16 @@ putListNgrams listId ngramsType nes = do
where where
m = Map.fromList $ (\n -> (n ^. ne_ngrams, ngramsElementToRepo n)) <$> nes m = Map.fromList $ (\n -> (n ^. ne_ngrams, ngramsElementToRepo n)) <$> nes
tableNgramsPost tabType listId = putListNgrams listId tabType tableNgramsPost :: RepoCmdM env err m => TabType -> NodeId -> [NgramsElement] -> m ()
tableNgramsPost tabType listId = putListNgrams listId (ngramsTypeFromTabType tabType)
-- Apply the given patch to the DB and returns the patch to be applied on the -- Apply the given patch to the DB and returns the patch to be applied on the
-- client. -- client.
tableNgramsPut :: (HasInvalidError err, RepoCmdM env err m) tableNgramsPut :: (HasInvalidError err, RepoCmdM env err m)
=> CorpusId -> TabType -> ListId => TabType -> ListId
-> Versioned NgramsTablePatch -> Versioned NgramsTablePatch
-> m (Versioned NgramsTablePatch) -> m (Versioned NgramsTablePatch)
tableNgramsPut _corpusId tabType listId (Versioned p_version p_table) tableNgramsPut tabType listId (Versioned p_version p_table)
| p_table == mempty = do | p_table == mempty = do
let ngramsType = ngramsTypeFromTabType tabType let ngramsType = ngramsTypeFromTabType tabType
...@@ -927,7 +928,6 @@ getTableNgrams nId tabType listId limit_ offset ...@@ -927,7 +928,6 @@ getTableNgrams nId tabType listId limit_ offset
type QueryParamR = QueryParam' '[Required, Strict] type QueryParamR = QueryParam' '[Required, Strict]
type TableNgramsApiGet = Summary " Table Ngrams API Get" type TableNgramsApiGet = Summary " Table Ngrams API Get"
:> QueryParamR "docId" DocId
:> QueryParamR "ngramsType" TabType :> QueryParamR "ngramsType" TabType
:> QueryParamR "list" ListId :> QueryParamR "list" ListId
:> QueryParamR "limit" Limit :> QueryParamR "limit" Limit
...@@ -986,11 +986,15 @@ type ApiNgramsTableDoc = TableNgramsApiGet ...@@ -986,11 +986,15 @@ type ApiNgramsTableDoc = TableNgramsApiGet
:<|> TableNgramsApiPut :<|> TableNgramsApiPut
:<|> TableNgramsApiPost :<|> TableNgramsApiPost
apiNgramsTableDoc :: (RepoCmdM env err m, HasNodeError err, HasConnection env) apiNgramsTableDoc :: ( RepoCmdM env err m
=> ServerT ApiNgramsTableDoc m , HasNodeError err
apiNgramsTableDoc = getTableNgramsDoc , HasInvalidError err
:<|> tableNgramsPut , HasConnection env
:<|> tableNgramsPost )
=> DocId -> ServerT ApiNgramsTableDoc m
apiNgramsTableDoc dId = getTableNgramsDoc dId
:<|> tableNgramsPut
:<|> tableNgramsPost
-- > add new ngrams in database (TODO AD) -- > add new ngrams in database (TODO AD)
-- > index all the corpus accordingly (TODO AD) -- > index all the corpus accordingly (TODO AD)
...@@ -171,7 +171,7 @@ nodeAPI p uId id ...@@ -171,7 +171,7 @@ nodeAPI p uId id
-- TODO gather it -- TODO gather it
:<|> getTable id :<|> getTable id
:<|> getTableNgramsCorpus id :<|> getTableNgramsCorpus id
:<|> tableNgramsPut id :<|> tableNgramsPut
:<|> getPairing id :<|> getPairing id
-- :<|> getTableNgramsDoc id -- :<|> getTableNgramsDoc id
......
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