Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

fix: minor fixes #24

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion go/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ type DeleteResponse struct{}
//ftl:ingress http DELETE /http/users/{userId}
func Delete(ctx context.Context, req builtin.HttpRequest[DeleteRequest]) (builtin.HttpResponse[DeleteResponse, ftl.Unit], error) {
return builtin.HttpResponse[DeleteResponse, ftl.Unit]{
Headers: map[string][]string{"Put": {"Header from FTL"}},
Headers: map[string][]string{"Delete": {"Header from FTL"}},
Body: ftl.Some(DeleteResponse{}),
}, nil
}
2 changes: 1 addition & 1 deletion online-boutique/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ dev:

# Start the example web frontend for online-boutique
web:
cd frontend/web && npm install && npm run dev
cd web && npm install && npm run dev
3 changes: 2 additions & 1 deletion online-boutique/backend/services/checkout/checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"context"
"fmt"

"github.com/TBD54566975/ftl/examples/online-boutique/slices"

"github.com/google/uuid"

"ftl/builtin"
Expand All @@ -14,7 +16,6 @@ import (
"ftl/productcatalog"
"ftl/shipping"

"github.com/TBD54566975/ftl/backend/common/slices"
"github.com/TBD54566975/ftl/examples/online-boutique/common/money"

"github.com/TBD54566975/ftl/go-runtime/ftl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Product struct {
Name string `json:"name"`
Description string `json:"description"`
Picture string `json:"picture"`
PriceUSD currency.Money `json:"priceUSD"`
PriceUSD currency.Money `json:"priceUsd"`

// Categories such as "clothing" or "kitchen" that can be used to look up
// other related products.
Expand Down
9 changes: 9 additions & 0 deletions online-boutique/backend/slices/slices.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package slices

func Map[T, U any](slice []T, fn func(T) U) []U {
result := make([]U, len(slice))
for i, v := range slice {
result[i] = fn(v)
}
return result
}
Loading