Delete a discord integration @Summary Delete discord integration @Description Delete a discord integration for a user @Security ApiKeyAuth @Tags Webhooks @Accept json @Produce json @Param discordID path string true "ID of the discord integration" default(32343a19-
(c fiber.Ctx)
| 124 | // @Failure 500 {object} responses.InternalServerError |
| 125 | // @Router /discord-integrations/{discordID} [delete] |
| 126 | func (h *DiscordHandler) Delete(c fiber.Ctx) error { |
| 127 | ctx, span, ctxLogger := h.tracer.StartFromFiberCtxWithLogger(c, h.logger) |
| 128 | defer span.End() |
| 129 | |
| 130 | discordID := c.Params("discordID") |
| 131 | if errors := h.validator.ValidateUUID(discordID, "discordID"); len(errors) != 0 { |
| 132 | msg := fmt.Sprintf("validation errors [%s], while deleting discord integration with ID [%s]", spew.Sdump(errors), discordID) |
| 133 | ctxLogger.Warn(stacktrace.NewError(msg)) |
| 134 | return h.responseUnprocessableEntity(c, errors, "validation errors while deleting discord integration") |
| 135 | } |
| 136 | |
| 137 | err := h.service.Delete(ctx, h.userIDFomContext(c), uuid.MustParse(discordID)) |
| 138 | if err != nil { |
| 139 | msg := fmt.Sprintf("cannot delete discord integration with ID [%+#v]", discordID) |
| 140 | ctxLogger.Error(stacktrace.Propagate(err, msg)) |
| 141 | return h.responseInternalServerError(c) |
| 142 | } |
| 143 | |
| 144 | return h.responseOK(c, "discord integration deleted successfully", nil) |
| 145 | } |
| 146 | |
| 147 | // Update an entities.Discord |
| 148 | // @Summary Update a discord integration |
nothing calls this directly
no test coverage detected