Delete an entities.User @Summary Delete a user @Description Deletes the currently authenticated user together with all their data. @Security ApiKeyAuth @Tags Users @Accept json @Produce json @Success 201 {object} responses.NoContent @Failure 401 {object} respon
(c fiber.Ctx)
| 133 | // @Failure 500 {object} responses.InternalServerError |
| 134 | // @Router /users/me [delete] |
| 135 | func (h *UserHandler) Delete(c fiber.Ctx) error { |
| 136 | ctx, span, ctxLogger := h.tracer.StartFromFiberCtxWithLogger(c, h.logger) |
| 137 | defer span.End() |
| 138 | |
| 139 | if err := h.service.Delete(ctx, c.OriginalURL(), h.userIDFomContext(c)); err != nil { |
| 140 | msg := fmt.Sprintf("cannot delete user user with ID [%s]", h.userIDFomContext(c)) |
| 141 | ctxLogger.Error(stacktrace.Propagate(err, msg)) |
| 142 | return h.responseInternalServerError(c) |
| 143 | } |
| 144 | |
| 145 | return h.responseNoContent(c, "user deleted successfully") |
| 146 | } |
| 147 | |
| 148 | // UpdateNotifications an entities.User |
| 149 | // @Summary Update notification settings |
nothing calls this directly
no test coverage detected