Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed incorrect decode & encode instance for Method #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Presto/Core/Types/API.purs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Data.Foreign (F)
import Data.Foreign.Class (class Decode, class Encode)
import Data.Foreign.Generic.Class (class GenericDecode, class GenericEncode)
import Data.Generic.Rep (class Generic)
import Presto.Core.Utils.Encoding (defaultDecode, defaultEncode, defaultDecodeJSON, defaultEncodeJSON)
import Presto.Core.Utils.Encoding (defaultDecode, defaultEnumEncode,defaultEnumDecode, defaultEncode, defaultDecodeJSON, defaultEncodeJSON)

class RestEndpoint a b | a -> b, b -> a where
makeRequest :: a -> Headers -> Request
Expand Down Expand Up @@ -92,9 +92,9 @@ type ErrorResponse = Response ErrorPayload

derive instance genericMethod :: Generic Method _
instance encodeMethod :: Encode Method where
encode = defaultEncode
encode = defaultEnumEncode
instance decodeMethod :: Decode Method where
decode = defaultDecode
decode = defaultEnumDecode
instance showMethod :: Show Method where
show POST = "POST"
show GET = "GET"
Expand All @@ -118,7 +118,7 @@ instance encodeRequestG :: Encode Request where
encode = defaultEncode
instance decodeRequestG :: Decode Request where
decode = defaultDecode

derive instance genericErrorPayload :: Generic ErrorPayload _
instance encodeErrorPayload :: Encode ErrorPayload where
encode = defaultEncode
Expand Down