subscriptionUpdateURL returns the subscription update URL for the authenticated entities.User @Summary Currently authenticated user subscription update URL @Description Fetches the subscription URL of the authenticated user. @Security ApiKeyAuth @Tags Users @Produce json @Success
(c fiber.Ctx)
| 194 | // @Failure 500 {object} responses.InternalServerError |
| 195 | // @Router /users/subscription-update-url [get] |
| 196 | func (h *UserHandler) subscriptionUpdateURL(c fiber.Ctx) error { |
| 197 | ctx, span := h.tracer.StartFromFiberCtx(c) |
| 198 | defer span.End() |
| 199 | |
| 200 | ctxLogger := h.tracer.CtxLogger(h.logger, span) |
| 201 | authUser := h.userFromContext(c) |
| 202 | |
| 203 | url, err := h.service.GetSubscriptionUpdateURL(ctx, authUser.ID) |
| 204 | if err != nil { |
| 205 | msg := fmt.Sprintf("cannot get user with ID [%s]", authUser.ID) |
| 206 | ctxLogger.Error(stacktrace.Propagate(err, msg)) |
| 207 | return h.responseInternalServerError(c) |
| 208 | } |
| 209 | |
| 210 | return h.responseOK(c, "Subscription update URL fetched successfully", url) |
| 211 | } |
| 212 | |
| 213 | // cancelSubscription cancels the subscription for the authenticated entities.User |
| 214 | // @Summary Cancel the user's subscription |
nothing calls this directly
no test coverage detected