Commit 689ace0f authored by Alexandre Delanoë's avatar Alexandre Delanoë

[API][NGRAMS] NgramsElement without ids.

parent 6651d0d6
......@@ -84,11 +84,10 @@ instance Arbitrary TabType
------------------------------------------------------------------------
data NgramsElement =
NgramsElement { _ne_id :: Int
, _ne_ngrams :: Text
NgramsElement { _ne_ngrams :: Text
, _ne_list :: ListType
}
deriving (Ord, Eq)
deriving (Ord, Eq, Show)
$(deriveJSON (unPrefix "_ne_") ''NgramsElement)
......@@ -105,8 +104,8 @@ $(deriveJSON (unPrefix "_") ''NgramsTable)
data NgramsPatch =
NgramsPatch { _np_list_types :: ListType -- TODO Map UserId ListType
, _np_add_children :: Set NgramsId
, _np_rem_children :: Set NgramsId
, _np_add_children :: Set NgramsElement
, _np_rem_children :: Set NgramsElement
}
deriving (Ord, Eq, Show, Generic)
$(deriveJSON (unPrefix "_np_") ''NgramsPatch)
......@@ -119,7 +118,7 @@ instance Arbitrary NgramsPatch where
--
data NgramsIdPatch =
NgramsIdPatch { _nip_ngramsId :: NgramsId
NgramsIdPatch { _nip_ngramsId :: NgramsElement
, _nip_ngramsPatch :: NgramsPatch
}
deriving (Ord, Eq, Show, Generic)
......
......@@ -48,7 +48,7 @@ import Database.PostgreSQL.Simple (Connection)
import GHC.Generics (Generic)
import Servant
import Gargantext.API.Ngrams (TabType(..), TableNgramsApi, TableNgramsApiGet,tableNgramsPatch, getTableNgramsPatch, NgramsIdPatchsFeed, NgramsIdPatchsBack)
import Gargantext.API.Ngrams (TabType(..), TableNgramsApi, TableNgramsApiGet,tableNgramsPatch, getTableNgramsPatch, NgramsIdPatchsFeed, NgramsIdPatchsBack, NgramsTable)
import Gargantext.Prelude
import Gargantext.Database.Types.Node
import Gargantext.Database.Node ( runCmd
......@@ -289,7 +289,7 @@ getNodesWith' conn id p nodeType offset limit = liftIO (getNodesWith conn id p
tableNgramsPatch' :: Connection -> CorpusId -> Maybe ListId -> NgramsIdPatchsFeed -> Handler NgramsIdPatchsBack
tableNgramsPatch' c cId mL ns = liftIO $ tableNgramsPatch c cId mL ns
getTableNgramsPatch' :: Connection -> CorpusId -> Maybe TabType -> Maybe ListId -> Handler NgramsIdPatchsBack
getTableNgramsPatch' :: Connection -> CorpusId -> Maybe TabType -> Maybe ListId -> Handler NgramsTable
getTableNgramsPatch' c cId nType mL = liftIO $ getTableNgramsPatch c cId nType mL
query :: Text -> Handler Text
......
......@@ -139,7 +139,7 @@ instance ToJSON a => ToJSON (Tree a) where
toJSON (TreeN node nodes) =
object ["node" A..= toJSON node, "children" A..= toJSON nodes]
instance FromJSON (Tree NodeTree)
instance FromJSON a => FromJSON (Tree a)
instance ToSchema NodeTree
instance ToSchema (Tree NodeTree)
......
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