1
0
Fork 0

feat(server): return TrainingDateAttendee data on GET, POST and PUT

This commit is contained in:
Vojtěch Mareš 2024-05-11 20:30:50 +02:00
parent 67f015ec97
commit 65bd079691
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D

View file

@ -3,6 +3,7 @@ package server
import (
"context"
"errors"
"github.com/oapi-codegen/runtime/types"
"time"
"github.com/gofiber/fiber/v2"
@ -501,8 +502,15 @@ func (h *APIHandlers) CreateTrainingDateAttendee(ctx context.Context, req Create
}
return CreateTrainingDateAttendee201JSONResponse{
Id: ta.ID,
Name: ta.Name,
Id: ta.ID,
Name: ta.Name,
Email: types.Email(ta.Email),
Phone: ta.Phone,
Company: ta.Company,
Position: ta.Position,
IsStudent: &ta.IsStudent,
HasAttended: ta.HasAttended,
HasPaid: ta.HasPaid,
}, nil
}
@ -560,8 +568,15 @@ func (h *APIHandlers) GetTrainingDateAttendee(ctx context.Context, req GetTraini
}
return GetTrainingDateAttendee200JSONResponse{
Id: ta.ID,
Name: ta.Name,
Id: ta.ID,
Name: ta.Name,
Email: types.Email(ta.Email),
Phone: ta.Phone,
Company: ta.Company,
Position: ta.Position,
IsStudent: &ta.IsStudent,
HasAttended: ta.HasAttended,
HasPaid: ta.HasPaid,
}, nil
}
@ -582,7 +597,14 @@ func (h *APIHandlers) UpdateTrainingDateAttendee(ctx context.Context, req Update
}
return UpdateTrainingDateAttendee200JSONResponse{
Id: ta.ID,
Name: ta.Name,
Id: ta.ID,
Name: ta.Name,
Email: types.Email(ta.Email),
Phone: ta.Phone,
Company: ta.Company,
Position: ta.Position,
IsStudent: &ta.IsStudent,
HasAttended: ta.HasAttended,
HasPaid: ta.HasPaid,
}, nil
}