rentease/internal/server/handle_payments.go
2025-01-19 15:23:54 +01:00

27 lines
497 B
Go

package server
import (
"log"
"net/http"
"strconv"
"github.com/labstack/echo/v4"
"github.com/rjNemo/rentease/internal/service/booking"
"github.com/rjNemo/rentease/internal/view"
)
func handleCreatePaymentModal(bs *booking.Service) echo.HandlerFunc {
return func(c echo.Context) error {
idStr := c.Param("id")
id, err := strconv.Atoi(idStr)
if err != nil {
return err
}
b := bs.One(id)
log.Println(b)
return renderTempl(c, http.StatusOK, view.PaymentModal(b.Id))
}
}