udpate purescript package set
This commit is contained in:
parent
b0664136e3
commit
f8be202f15
|
@ -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 = {=}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,13 +200,12 @@ 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
|
||||
if (edit_note.id == 0)
|
||||
then do
|
||||
liftEffect (setHref (fromNullableStr app.noteR) =<< _loc)
|
||||
else do
|
||||
_note .= edit_note
|
||||
_edit .= false
|
||||
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)
|
||||
else do
|
||||
_note .= edit_note
|
||||
_edit .= false
|
||||
|
|
2
static/js/app.min.js
vendored
2
static/js/app.min.js
vendored
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.
Loading…
Reference in a new issue