update events
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
)
|
||||
|
||||
func (h *Handler) CreateEvent(c echo.Context) (err error) {
|
||||
newEvent := new(model.Event)
|
||||
event := new(model.CreateEvent)
|
||||
authorId, err := strconv.Atoi(c.Request().Header.Get("UserId"))
|
||||
orgId, err := strconv.Atoi(c.Request().Header.Get("UserOrganizationId"))
|
||||
@@ -33,15 +32,10 @@ func (h *Handler) CreateEvent(c echo.Context) (err error) {
|
||||
employee := usersMap[event.EmployeeId]
|
||||
author := usersMap[uint(authorId)]
|
||||
|
||||
newEvent.Start = event.Start
|
||||
newEvent.End = event.End
|
||||
newEvent.AuthorId = uint(authorId)
|
||||
newEvent.EmployeeId = event.EmployeeId
|
||||
newEvent.MemberId = event.MemberId
|
||||
newEvent.MedicalCardId = event.MedicalCardId
|
||||
newEvent.Status = event.Status
|
||||
newEvent.Services = event.Services
|
||||
newEvent, err := utils.TypeConverter[model.Event](event)
|
||||
|
||||
newEvent.OrgId = uint(orgId)
|
||||
newEvent.AuthorId = uint(authorId)
|
||||
|
||||
tx := h.DB.Create(&newEvent)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user