@@ -2,9 +2,10 @@ module Data.Api exposing
22 ( Endpoint (..) , get, post, put, patch, delete
33 , withJsonBody, withStringResponse, withJsonResponse, withStringErrorHandler, withErrorHandler
44 , sendRequest
5- , FormErrors , initialErrors, addError, addErrors , prefixedArrayErrors
5+ , FormErrors , initialErrors, addError, prefixedArrayErrors
66 , apiFailureToError, formErrorsDecoder
77 , errorHtml, generalFormErrors, getErrorHtml
8+ , addErrors
89 )
910
1011{- |
@@ -79,8 +80,10 @@ type Endpoint
7980 | CheckoutPlaceOrderAnonymous
8081 | CheckoutSuccess
8182 | GuestCheckoutSuccess
82- | CheckoutHelcimToken
83- | CheckoutHelcimTokenAnonymous
83+ | HelcimValidateCheckout
84+ | HelcimValidateCheckoutAnonymous
85+ | StripeValidateCheckout
86+ | StripeValidateCheckoutAnonymous
8487 | AdminCategoryList
8588 | AdminNewCategory
8689 | AdminEditCategoryData CategoryId
@@ -244,12 +247,18 @@ toUrl endpoint =
244247 GuestCheckoutSuccess ->
245248 joinPath [ " checkout" , " anonymous-success" ]
246249
247- CheckoutHelcimToken ->
250+ HelcimValidateCheckout ->
248251 joinPath [ " checkout" , " helcim-checkout-token" ]
249252
250- CheckoutHelcimTokenAnonymous ->
253+ HelcimValidateCheckoutAnonymous ->
251254 joinPath [ " checkout" , " anonymous-helcim-checkout-token" ]
252255
256+ StripeValidateCheckout ->
257+ joinPath [ " checkout" , " validate-customer-details" ]
258+
259+ StripeValidateCheckoutAnonymous ->
260+ joinPath [ " checkout" , " validate-anonymous-customer-details" ]
261+
253262 AdminCategoryList ->
254263 joinPath [ " admin" , " categories" , " list" ]
255264
@@ -582,6 +591,7 @@ addError : Field -> ErrorMessage -> FormErrors -> FormErrors
582591addError field message errors =
583592 addErrors field [ message ] errors
584593
594+
585595addErrors : Field -> List ErrorMessage -> FormErrors -> FormErrors
586596addErrors field messages errors =
587597 ( \ a -> Dict . update field a errors) <|
0 commit comments