update person models

This commit is contained in:
kandrusyak
2023-08-03 02:23:53 +03:00
parent aeccf956f7
commit ccba5f3844
4 changed files with 24 additions and 22 deletions

View File

@@ -17,7 +17,7 @@ import (
// 200: Event
func (h *Handler) CreateEvent(c echo.Context) (err error) {
var person *model.PersonalInformation
var person *model.PersonalInformationApi
event := new(model.CreateEvent)
authorId, err := uuid.Parse(c.Request().Header.Get("UserId"))
orgId, err := uuid.Parse(c.Request().Header.Get("UserOrganizationId"))
@@ -38,7 +38,7 @@ func (h *Handler) CreateEvent(c echo.Context) (err error) {
return c.NoContent(http.StatusBadRequest)
}
} else {
newPerson := model.PersonalInformationCreate{
newPerson := model.PersonalInformationApi{
FirstName: event.Person.FirstName,
LastName: event.Person.LastName,
Patronymic: event.Person.Patronymic,
@@ -71,7 +71,7 @@ func (h *Handler) CreateEvent(c echo.Context) (err error) {
newEvent.MedicId = event.MedicId
newEvent.AuthorId = authorId
newEvent.PersonId = person.ID
newEvent.Person = *person
newEvent.Person = person
tx := h.DB.Create(&newEvent)