Skip to content

Commit

Permalink
fix: typo in handler name (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
turip authored Dec 9, 2024
1 parent 7054e80 commit b8d7638
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions openmeter/billing/httpdriver/invoiceline.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ var _ InvoiceLineHandler = (*handler)(nil)

type (
CreatePendingLineRequest = billing.CreateInvoiceLinesInput
CraetePendingLineResponse = []api.InvoiceLine
CreatePendingLineHandler = httptransport.Handler[CreatePendingLineRequest, CraetePendingLineResponse]
CreatePendingLineResponse = []api.InvoiceLine
CreatePendingLineHandler = httptransport.Handler[CreatePendingLineRequest, CreatePendingLineResponse]
)

func (h *handler) CreatePendingLine() CreatePendingLineHandler {
Expand Down Expand Up @@ -63,25 +63,25 @@ func (h *handler) CreatePendingLine() CreatePendingLineHandler {
Lines: lineEntities,
}, nil
},
func(ctx context.Context, request CreatePendingLineRequest) (CraetePendingLineResponse, error) {
func(ctx context.Context, request CreatePendingLineRequest) (CreatePendingLineResponse, error) {
lines, err := h.service.CreatePendingInvoiceLines(ctx, request)
if err != nil {
return CraetePendingLineResponse{}, fmt.Errorf("failed to create invoice lines: %w", err)
return CreatePendingLineResponse{}, fmt.Errorf("failed to create invoice lines: %w", err)
}

res := make(CraetePendingLineResponse, 0, len(lines))
res := make(CreatePendingLineResponse, 0, len(lines))

for _, line := range lines {
line, err := mapBillingLineToAPI(line)
if err != nil {
return CraetePendingLineResponse{}, fmt.Errorf("failed to map line: %w", err)
return CreatePendingLineResponse{}, fmt.Errorf("failed to map line: %w", err)
}
res = append(res, line)
}

return res, nil
},
commonhttp.JSONResponseEncoderWithStatus[CraetePendingLineResponse](http.StatusCreated),
commonhttp.JSONResponseEncoderWithStatus[CreatePendingLineResponse](http.StatusCreated),
httptransport.AppendOptions(
h.options,
httptransport.WithOperationName("CreateInvoiceLineByCustomer"),
Expand Down

0 comments on commit b8d7638

Please sign in to comment.