mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-01 12:06:38 +08:00
fix subscription management loading
This commit is contained in:
@@ -84,7 +84,7 @@ func createSubscriptionHandler(svc *service.Container) gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
enriched := []model.Subscription{*s}
|
||||
svc.Subscription.EnrichProgress(c.Request.Context(), enriched)
|
||||
svc.Subscription.EnrichManagementProgress(c.Request.Context(), enriched)
|
||||
*s = enriched[0]
|
||||
c.JSON(http.StatusCreated, s)
|
||||
}
|
||||
@@ -97,7 +97,7 @@ func listSubscriptionsHandler(svc *service.Container) gin.HandlerFunc {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
svc.Subscription.EnrichProgress(c.Request.Context(), items)
|
||||
svc.Subscription.EnrichManagementProgress(c.Request.Context(), items)
|
||||
go enrichAndPersistSubscriptions(context.Background(), svc, append([]model.Subscription(nil), items...))
|
||||
c.JSON(http.StatusOK, gin.H{"items": items})
|
||||
}
|
||||
@@ -110,7 +110,7 @@ func listSubscriptionHistoryHandler(svc *service.Container) gin.HandlerFunc {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
svc.Subscription.EnrichProgress(c.Request.Context(), items)
|
||||
svc.Subscription.EnrichManagementProgress(c.Request.Context(), items)
|
||||
c.JSON(http.StatusOK, gin.H{"items": items})
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ func restoreSubscriptionHandler(svc *service.Container) gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
enriched := []model.Subscription{*sub}
|
||||
svc.Subscription.EnrichProgress(c.Request.Context(), enriched)
|
||||
svc.Subscription.EnrichManagementProgress(c.Request.Context(), enriched)
|
||||
c.JSON(http.StatusOK, enriched[0])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user