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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
dbe0f774
Commit
dbe0f774
authored
Mar 08, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
successful addcorpus view
parent
87f2e795
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
AddCorpusview.purs
src/AddCorpusview.purs
+9
-10
No files found.
src/AddCorpusview.purs
View file @
dbe0f774
...
@@ -36,9 +36,8 @@ type State =
...
@@ -36,9 +36,8 @@ type State =
newtype Response = Response
newtype Response = Response
{
{
count_count :: Int
count :: Int
, count_message :: Maybe String
, name :: String
, count_name :: String
}
}
initialState :: State
initialState :: State
...
@@ -109,8 +108,8 @@ fn1 :: Response -> ReactElement
...
@@ -109,8 +108,8 @@ fn1 :: Response -> ReactElement
fn1 (Response o) =
fn1 (Response o) =
li [className "list-group-item justify-content-between"]
li [className "list-group-item justify-content-between"]
[
[
span [] [text
$ fromMaybe "" o.count_messag
e]
span [] [text
o.nam
e]
, span [className "badge badge-default badge-pill"] [ text $ show o.count
_count
]
, span [className "badge badge-default badge-pill"] [ text $ show o.count]
]
]
...
@@ -152,7 +151,9 @@ getDatabaseDetails reqBody = do
...
@@ -152,7 +151,9 @@ getDatabaseDetails reqBody = do
}
}
case affResp of
case affResp of
Left err -> do
Left err -> do
liftAff $ log $ "error" <> show err
pure $ Left $ show err
pure $ Left $ show err
Right a -> do
Right a -> do
liftAff $ log $ "POST method Completed"
liftAff $ log $ "POST method Completed"
liftAff $ log $ "GET /api response: " <> show a.response
liftAff $ log $ "GET /api response: " <> show a.response
...
@@ -160,11 +161,9 @@ getDatabaseDetails reqBody = do
...
@@ -160,11 +161,9 @@ getDatabaseDetails reqBody = do
pure res
pure res
instance decodeJsonresponse :: DecodeJson Response where
instance decodeJsonresponse :: DecodeJson Response where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
count_count <- obj .? "count_count"
count <- obj .? "count"
count_message <- obj .? "count_message"
name <- obj .? "name"
count_name <- obj .? "count_name"
pure $ Response {count,name }
pure $ Response {count_count,count_message,count_name }
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