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
1
Merge Requests
1
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
2574713c
Commit
2574713c
authored
Aug 25, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor] remove some dead code
parent
39a3fdef
Pipeline
#1731
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
21 deletions
+5
-21
REST.purs
src/Gargantext/Config/REST.purs
+0
-5
CacheAPI.purs
src/Gargantext/Utils/CacheAPI.purs
+5
-16
No files found.
src/Gargantext/Config/REST.purs
View file @
2574713c
...
@@ -65,11 +65,6 @@ readJSON affResp =
...
@@ -65,11 +65,6 @@ readJSON affResp =
Left err -> Left $ ReadJSONError err
Left err -> Left $ ReadJSONError err
Right r -> Right r
Right r -> Right r
-- readJSONOrFail affResp = do
-- case readJSON affResp of
-- Left err -> throwError $ error $ "decodeJson affResp.body: " <> show err
-- Right b -> pure b
-- TODO too much duplicate code in `postWwwUrlencoded`
-- TODO too much duplicate code in `postWwwUrlencoded`
send :: forall body res. JSON.WriteForeign body => JSON.ReadForeign res =>
send :: forall body res. JSON.WriteForeign body => JSON.ReadForeign res =>
Method -> Maybe Token -> String -> Maybe body -> Aff (Either RESTError res)
Method -> Maybe Token -> String -> Maybe body -> Aff (Either RESTError res)
...
...
src/Gargantext/Utils/CacheAPI.purs
View file @
2574713c
module Gargantext.Utils.CacheAPI where
module Gargantext.Utils.CacheAPI where
import Gargantext.Prelude hiding (add)
import Control.Monad.Except (runExcept)
import Control.Monad.Except (runExcept)
import Control.Promise (Promise, toAffE)
import Control.Promise (Promise, toAffE)
import Data.Either (Either(..))
import Data.Either (Either(..))
...
@@ -10,25 +12,12 @@ import Effect.Aff (Aff, throwError)
...
@@ -10,25 +12,12 @@ import Effect.Aff (Aff, throwError)
import Effect.Exception (error)
import Effect.Exception (error)
import Foreign as F
import Foreign as F
import Foreign.Object as O
import Foreign.Object as O
import Gargantext.Ends (class ToUrl, toUrl)
import Gargantext.Sessions (Session(..))
import Milkis as M
import Milkis as M
import Simple.JSON as JSON
import Simple.JSON as JSON
import Type.Row (class Union)
import Type.Row (class Union)
import Gargantext.Prelude hiding (add)
import Gargantext.Ends (class ToUrl, toUrl)
import Gargantext.Sessions (Session(..))
get :: forall a p. JSON.ReadForeign a => ToUrl Session p => Cache -> Session -> p -> Aff a
get cache session p = do
let req = makeGetRequest session p
res <- cached cache req
j <- M.text res
case JSON.readJSON j of
Left err -> throwError $ error $ "decodeJson affResp.body: " <> show err
Right b -> pure b
foreign import data Cache :: Type
foreign import data Cache :: Type
foreign import data Request :: Type
foreign import data Request :: Type
...
@@ -119,7 +108,7 @@ pureJson req = do
...
@@ -119,7 +108,7 @@ pureJson req = do
Right b -> pure b
Right b -> pure b
foreign import _makeRequest :: forall options
trash
.
foreign import _makeRequest :: forall options.
M.URL -> { method :: M.Method, headers :: M.Headers | options } -> Request
M.URL -> { method :: M.Method, headers :: M.Headers | options } -> Request
foreign import _openCache :: String -> Effect (Promise Cache)
foreign import _openCache :: String -> Effect (Promise Cache)
foreign import _delete :: String -> Effect (Promise Unit)
foreign import _delete :: String -> Effect (Promise Unit)
...
...
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