You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very tedious dealing with builtin.HttpRequest/HttpResponse. Let's update the external module template with some custom helpers for that module. Something like:
`builtin/external_module.go` will have a couple of helper functions
added:
```
// A helper for successful HttpResponse
//
func HttpSuccess[E any, B any](code int, body B) HttpResponse[B, E] {
return HttpResponse[B, E]{Status: code, Body: ftl.Some(body)}
}
// A helper for HttpResponse with error
//
func HttpError[B any, E any](code int, e E) HttpResponse[B, E] {
return HttpResponse[B, E]{Status: code, Error: ftl.Some(e)}
}
```
Fixes: #1632
It is very tedious dealing with
builtin.HttpRequest
/HttpResponse
. Let's update the external module template with some custom helpers for that module. Something like:Which would replace:
With:
etc.
The text was updated successfully, but these errors were encountered: