WIP: add missing handlers, services nd repositories
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"kontor-api-gin/internal/globals"
|
||||
"kontor-api-gin/internal/models"
|
||||
"kontor-api-gin/internal/repository"
|
||||
"kontor-api-gin/internal/service"
|
||||
"kontor-api-echo/internal/globals"
|
||||
"kontor-api-echo/internal/models"
|
||||
"kontor-api-echo/internal/repository"
|
||||
"kontor-api-echo/internal/service"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/uptrace/bun"
|
||||
@@ -170,8 +169,8 @@ func (handler *MediaLoFiHandler) ChangeReviewPage(c *echo.Context) {
|
||||
lofi.Review = !lofi.Review
|
||||
handler.Service.Update(c.Request().Context(), lofi.ConvertMediaLoFiToDTO())
|
||||
logger.Info("MediaLoFiHandler#ChangeReviewPage", "lofi", lofi)
|
||||
session := sessions.Default(c)
|
||||
user := session.Get(globals.UserKey)
|
||||
cookie, err := c.Cookie(globals.UserKey)
|
||||
user := cookie.Value
|
||||
lofis, err := handler.Service.List(c.Request().Context())
|
||||
if err != nil {
|
||||
logger.Info("MediaLoFiHandler#ChangeReviewPage", "error", err.Error())
|
||||
@@ -199,7 +198,7 @@ func (handler *MediaLoFiHandler) UpdatePage(c *echo.Context) {
|
||||
var form models.MediaLoFiForm
|
||||
if err := c.Bind(&form); err != nil {
|
||||
logger.Info("MediaLoFiHandler#UpdatePage", "error", err.Error())
|
||||
c.Render(http.StatusBadRequest, "lofi_detail", map[string]string{
|
||||
c.Render(http.StatusBadRequest, "lofi_detail", map[string]any{
|
||||
"Form": form,
|
||||
"Errors": err.Error(),
|
||||
"user": user,
|
||||
|
||||
Reference in New Issue
Block a user