feat(server): return TrainingDateAttendee data on GET, POST and PUT
This commit is contained in:
parent
67f015ec97
commit
65bd079691
1 changed files with 28 additions and 6 deletions
|
|
@ -3,6 +3,7 @@ package server
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"github.com/oapi-codegen/runtime/types"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
|
|
@ -501,8 +502,15 @@ func (h *APIHandlers) CreateTrainingDateAttendee(ctx context.Context, req Create
|
||||||
}
|
}
|
||||||
|
|
||||||
return CreateTrainingDateAttendee201JSONResponse{
|
return CreateTrainingDateAttendee201JSONResponse{
|
||||||
Id: ta.ID,
|
Id: ta.ID,
|
||||||
Name: ta.Name,
|
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
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -560,8 +568,15 @@ func (h *APIHandlers) GetTrainingDateAttendee(ctx context.Context, req GetTraini
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetTrainingDateAttendee200JSONResponse{
|
return GetTrainingDateAttendee200JSONResponse{
|
||||||
Id: ta.ID,
|
Id: ta.ID,
|
||||||
Name: ta.Name,
|
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
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -582,7 +597,14 @@ func (h *APIHandlers) UpdateTrainingDateAttendee(ctx context.Context, req Update
|
||||||
}
|
}
|
||||||
|
|
||||||
return UpdateTrainingDateAttendee200JSONResponse{
|
return UpdateTrainingDateAttendee200JSONResponse{
|
||||||
Id: ta.ID,
|
Id: ta.ID,
|
||||||
Name: ta.Name,
|
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
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue