Fix api attachment urls
This commit is contained in:
@@ -21,9 +21,9 @@ func InitApiEndpointHandler() {
|
||||
|
||||
func (ps *ApiEndpointHandler) GetRandomPost(c *gin.Context) {
|
||||
post := ps.PostService.GetRandomPost()
|
||||
for _, attachment := range post.Attachments {
|
||||
attachment.RemoteUrl = services.GetRemoteUrl(attachment.RemoteUrl)
|
||||
attachment.PreviewUrl = services.GetPreviewUrl(attachment.RemoteUrl)
|
||||
for i := range post.Attachments {
|
||||
post.Attachments[i].RemoteUrl = services.GetRemoteUrl(post.Attachments[i].RemoteUrl)
|
||||
post.Attachments[i].PreviewUrl = services.GetPreviewUrl(post.Attachments[i].RemoteUrl)
|
||||
}
|
||||
c.JSON(200, post)
|
||||
}
|
||||
|
Reference in New Issue
Block a user