Minor improvements to admin panel API
This commit is contained in:
		@@ -15,7 +15,7 @@ func GetPreviewUrl(url string) string {
 | 
			
		||||
	if config.Config.ImageKitId == "" {
 | 
			
		||||
		return url
 | 
			
		||||
	}
 | 
			
		||||
	return "https://ik.imagekit.io/" + config.Config.ImageKitId + "/tr:w-500,h-500,c-at_max,f-webp,q-60/" + url
 | 
			
		||||
	return "https://ik.imagekit.io/" + config.Config.ImageKitId + "/tr:w-500,h-500,c-at_max,f-webp,q-50/" + url
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func GetRemoteUrl(url string) string {
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ func (ps *AdminDashboardHandler) RejectMedia(c *gin.Context) {
 | 
			
		||||
 | 
			
		||||
func (ps *AdminDashboardHandler) GetMedia(c *gin.Context) {
 | 
			
		||||
	media := ps.PostService.GetMedia()
 | 
			
		||||
	media.PreviewUrl = services.GetPreviewUrl(media.PreviewUrl)
 | 
			
		||||
	media.PreviewUrl = services.GetPreviewUrl(media.RemoteUrl)
 | 
			
		||||
	media.RemoteUrl = services.GetPreviewUrl(media.RemoteUrl)
 | 
			
		||||
	c.JSON(http.StatusOK, media)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user