MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / Delete

Method Delete

api/pkg/handlers/user_handler.go:135–146  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

133// @Failure 500 {object} responses.InternalServerError
134// @Router /users/me [delete]
135func (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

Callers

nothing calls this directly

Calls 6

userIDFomContextMethod · 0.80
responseNoContentMethod · 0.80
DeleteMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected