fix(server): use errors.Is() for error comparison
This commit is contained in:
parent
4a58dc3a81
commit
040609b80d
1 changed files with 1 additions and 1 deletions
|
|
@ -524,7 +524,7 @@ func (h *APIHandlers) GetTrainingDateAttendeeCount(ctx context.Context, req GetT
|
||||||
|
|
||||||
func (h *APIHandlers) DeleteTrainingDateAttendee(ctx context.Context, req DeleteTrainingDateAttendeeRequestObject) (DeleteTrainingDateAttendeeResponseObject, error) {
|
func (h *APIHandlers) DeleteTrainingDateAttendee(ctx context.Context, req DeleteTrainingDateAttendeeRequestObject) (DeleteTrainingDateAttendeeResponseObject, error) {
|
||||||
err := h.trainingDateAttendeeRepository.Delete(req.TrainingDateAttendeeID)
|
err := h.trainingDateAttendeeRepository.Delete(req.TrainingDateAttendeeID)
|
||||||
if err == training.ErrTrainingDateAttendeeNotFound {
|
if errors.Is(err, training.ErrTrainingDateAttendeeNotFound) {
|
||||||
return DeleteTrainingDateAttendee404ApplicationProblemPlusJSONResponse{
|
return DeleteTrainingDateAttendee404ApplicationProblemPlusJSONResponse{
|
||||||
NotFoundErrorApplicationProblemPlusJSONResponse: NotFoundErrorApplicationProblemPlusJSONResponse{
|
NotFoundErrorApplicationProblemPlusJSONResponse: NotFoundErrorApplicationProblemPlusJSONResponse{
|
||||||
Status: fiber.StatusNotFound,
|
Status: fiber.StatusNotFound,
|
||||||
|
|
|
||||||
Reference in a new issue