udpate purescript package set

This commit is contained in:
Jon Schoning 2019-11-13 22:03:21 -06:00
parent b0664136e3
commit f8be202f15
7 changed files with 25 additions and 26 deletions

View file

@ -1,8 +1,8 @@
let mkPackage =
https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.3-20190818/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57
https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.4-20191110/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57
let upstream =
https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.3-20190818/src/packages.dhall sha256:c95c4a8b8033a48a350106b759179f68a695c7ea2208228c522866fd43814dc8
https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.4-20191110/src/packages.dhall sha256:563a7f694e18e6399f7f6d01f5b7e3c3345781655d99945768f48e458feb93a4
let overrides = {=}

View file

@ -2,7 +2,7 @@ module App where
import Prelude
import Affjax (Response, ResponseFormatError)
import Affjax (Response, Error)
import Affjax (defaultRequest) as AX
import Affjax as Ax
import Affjax.RequestBody as AXReq
@ -34,28 +34,28 @@ toggleStar bid action = do
let path = "bm/" <> show bid <> "/" <> show action
void (fetchUrlEnc POST path Nothing AXRes.ignore)
destroy :: Int -> Aff (Response (Either ResponseFormatError Unit))
destroy :: Int -> Aff (Either Error (Response Unit))
destroy bid =
fetchUrlEnc DELETE ("bm/" <> show bid) Nothing AXRes.ignore
markRead :: Int -> Aff (Response (Either ResponseFormatError Unit))
markRead :: Int -> Aff (Either Error (Response Unit))
markRead bid = do
let path = "bm/" <> show bid <> "/read"
fetchUrlEnc POST path Nothing AXRes.ignore
editBookmark :: Bookmark -> Aff (Response (Either ResponseFormatError Unit))
editBookmark :: Bookmark -> Aff (Either Error (Response Unit))
editBookmark bm = do
fetchJson POST "api/add" (Just (Bookmark' bm)) AXRes.ignore
editNote :: Note -> Aff (Response (Either ResponseFormatError Json))
editNote :: Note -> Aff (Either Error (Response Json))
editNote bm = do
fetchJson POST "api/note/add" (Just (Note' bm)) AXRes.json
destroyNote :: Int -> Aff (Response (Either ResponseFormatError Unit))
destroyNote :: Int -> Aff (Either Error (Response Unit))
destroyNote nid = do
fetchUrlEnc DELETE ("api/note/" <> show nid) Nothing AXRes.ignore
editAccountSettings :: AccountSettings -> Aff (Response (Either ResponseFormatError Unit))
editAccountSettings :: AccountSettings -> Aff (Either Error (Response Unit))
editAccountSettings us = do
fetchJson POST "api/accountSettings" (Just (AccountSettings' us)) AXRes.ignore
@ -73,7 +73,7 @@ fetchJson
-> String
-> Maybe b
-> AXRes.ResponseFormat a
-> Aff (Response (Either ResponseFormatError a))
-> Aff (Either Error (Response a))
fetchJson method path content rt =
fetchPath method path [ContentType applicationJSON] (AXReq.string <<< J.writeJSON <$> content) rt
@ -83,7 +83,7 @@ fetchUrlEnc
-> String
-> Maybe FormURLEncoded
-> AXRes.ResponseFormat a
-> Aff (Response (Either ResponseFormatError a))
-> Aff (Either Error (Response a))
fetchUrlEnc method path content rt =
fetchPath method path [ContentType applicationFormURLEncoded] (AXReq.FormURLEncoded <$> content) rt
@ -94,7 +94,7 @@ fetchPath
-> Array RequestHeader
-> Maybe AXReq.RequestBody
-> AXRes.ResponseFormat a
-> Aff (Response (Either ResponseFormatError a))
-> Aff (Either Error (Response a))
fetchPath method path headers content rt =
fetchUrl method ((app' unit).homeR <> path) headers content rt
@ -105,7 +105,7 @@ fetchUrl
-> Array RequestHeader
-> Maybe AXReq.RequestBody
-> AXRes.ResponseFormat a
-> Aff (Response (Either ResponseFormatError a))
-> Aff (Either Error (Response a))
fetchUrl method url headers content rt =
Ax.request
AX.defaultRequest

View file

@ -5,7 +5,7 @@ import Prelude hiding (div)
import App (destroyNote, editNote)
import Component.Markdown as Markdown
import Data.Array (drop, foldMap)
import Data.Either (Either(..))
import Data.Foldable (for_)
import Data.Lens (Lens', lens, use, (%=), (.=))
import Data.Maybe (Maybe(..), maybe)
import Data.Monoid (guard)
@ -200,10 +200,9 @@ nnote st' =
handleAction (NEditSubmit e) = do
H.liftEffect (preventDefault e)
edit_note <- use _edit_note
res <- H.liftAff (editNote edit_note)
case res.body of
Left err -> pure unit
Right r -> do
res' <- H.liftAff (editNote edit_note)
for_ res' \res -> do
let r = res.body
if (edit_note.id == 0)
then do
liftEffect (setHref (fromNullableStr app.noteR) =<< _loc)

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.