Commit 3744eee3 authored by Abinaya Sudhir's avatar Abinaya Sudhir

solving 405 method not allowed options

parent c0a13ee7
......@@ -20,6 +20,7 @@ import Data.MediaType.Common (applicationJSON)
import Network.HTTP.Affjax (AJAX, affjax, defaultRequest)
import Network.HTTP.RequestHeader (RequestHeader(..))
import Prelude hiding (div)
import React (ReactElement)
import React.DOM (a, button, div, form, h2, h3, h4, i, input, label, li, p, span, text, ul)
import React.DOM.Props (_id, _type, className, href, maxLength, name, onClick, onInput, placeholder, target, value)
import Routing.Hash.Aff (setHash)
......@@ -95,13 +96,7 @@ addcorpusviewSpec = simpleSpec performAction render
, div [className "col-md-9"]
[
h3 [] [text "Corpusview"]
, ul [className "list-group"]
[
li [className "list-group-item justify-content-between"]
[
span [className "badge badge-default badge-pill"] []
]
]
, ul [className "list-group"] $ map fn1 state.response
]
]
......@@ -110,6 +105,13 @@ addcorpusviewSpec = simpleSpec performAction render
]
fn1 :: Response -> ReactElement
fn1 (Response o) =
li [className "list-group-item justify-content-between"]
[
span [className "badge badge-default badge-pill"] [ text $ show o.count_count]
]
getDatabaseDetails :: forall eff. Aff (console::CONSOLE,ajax :: AJAX | eff) (Either String (Array Response))
getDatabaseDetails = do
let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MTk5OTg1ODMsInVzZXJfaWQiOjUsImVtYWlsIjoiYWxleGFuZHJlLmRlbGFub2VAaXNjcGlmLmZyIiwidXNlcm5hbWUiOiJkZXZlbG9wZXIifQ.Os-3wuFNSmRIxCZi98oFNBu2zqGc0McO-dgDayozHJg"
......
......@@ -69,7 +69,7 @@ performAction Login _ (State state) = void do
lift $ log $ show e
modifyState \(State s) -> State $ s { errorMessage = e}
Right r@(LoginRes response) -> do
lift $ setHash "/"
lift $ setHash "/addCorpus"
modifyState \(State s) -> State $ s {response = r, errorMessage = ""}
......@@ -176,7 +176,7 @@ loginReq encodeData =
let
setting =
defaultRequest
{ url = "http://unstable.gargantext.org/api/auth/token"
{ url = "https://dev.gargantext.org/api/auth/token"
, method = Left POST
, headers =
[ ContentType applicationJSON
......
......@@ -33,7 +33,7 @@ routing =
<|> addcorpusRoute
<|> home
where
addcorpusRoute = AddCorpus <$ route "AddCorpus"
addcorpusRoute = AddCorpus <$ route "addCorpus"
loginRoute = Login <$ route "login"
home = Home <$ lit ""
route str = lit "" *> lit str
......
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