chore: build
ci-api / test (push) Successful in 26m55s
ci-web / test (push) Successful in 14m57s

This commit is contained in:
Xor290
2026-08-18 14:46:05 +02:00
parent 02a5edd1b7
commit 955f2325fb
5 changed files with 87 additions and 0 deletions
@@ -220,6 +220,24 @@ func (h *Handler) SetDomain(c *gin.Context) {
}
// Extend : POST /demos/:id/extend — prolonge de 30 jours.
// TransferToPremium : POST /demos/:id/premium — passe la démo en
// abonnement payant (n'expire plus). La migration vers le namespace
// premium-<client> tourne en tâche de fond (voir Service.TransferToPaid) :
// la réponse reflète le changement de statut immédiat, pas la fin de la
// migration.
func (h *Handler) TransferToPremium(c *gin.Context) {
d, err := h.svc.TransferToPaidByID(c.Param("id"))
if err != nil {
if errors.Is(err, ErrNotFound) {
c.JSON(http.StatusNotFound, gin.H{"error": "démo introuvable"})
return
}
c.JSON(http.StatusInternalServerError, gin.H{"error": "erreur serveur"})
return
}
c.JSON(http.StatusOK, d)
}
func (h *Handler) Extend(c *gin.Context) {
d, err := h.svc.Extend(c.Param("id"))
if err != nil {