fix: 🐛 GetMedia imageKit dependencie
This commit is contained in:
@@ -15,17 +15,20 @@ type AdminDashboardHandler struct {
|
|||||||
postService *services.PostService
|
postService *services.PostService
|
||||||
jwt *auth.JwtTokenGenerator
|
jwt *auth.JwtTokenGenerator
|
||||||
cfg *config.Config
|
cfg *config.Config
|
||||||
|
imgKit *services.ImgKitHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewAdminDashboardHandler(
|
func NewAdminDashboardHandler(
|
||||||
postService *services.PostService,
|
postService *services.PostService,
|
||||||
jwt *auth.JwtTokenGenerator,
|
jwt *auth.JwtTokenGenerator,
|
||||||
cfg *config.Config,
|
cfg *config.Config,
|
||||||
|
imgKit *services.ImgKitHelper,
|
||||||
) *AdminDashboardHandler {
|
) *AdminDashboardHandler {
|
||||||
return &AdminDashboardHandler{
|
return &AdminDashboardHandler{
|
||||||
postService: postService,
|
postService: postService,
|
||||||
jwt: jwt,
|
jwt: jwt,
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
|
imgKit: imgKit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,8 +61,8 @@ func (adh *AdminDashboardHandler) RejectMedia(c *gin.Context) {
|
|||||||
func (adh *AdminDashboardHandler) GetMedia(c *gin.Context) {
|
func (adh *AdminDashboardHandler) GetMedia(c *gin.Context) {
|
||||||
media := adh.postService.GetMedia()
|
media := adh.postService.GetMedia()
|
||||||
// TODO: Fix this - we need to inject ImgKitHelper
|
// TODO: Fix this - we need to inject ImgKitHelper
|
||||||
// media.PreviewUrl = services.GetPreviewUrl(media.RemoteUrl)
|
media.PreviewUrl = adh.imgKit.GetPreviewUrl(media.RemoteUrl)
|
||||||
// media.RemoteUrl = services.GetPreviewUrl(media.RemoteUrl)
|
media.RemoteUrl = adh.imgKit.GetRemoteUrl(media.RemoteUrl)
|
||||||
c.JSON(http.StatusOK, media)
|
c.JSON(http.StatusOK, media)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user