| @@ -203,24 +203,22 @@ func GetPresignedPutObjectURL(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| uuid := "" | |||||
| url := "" | |||||
| if setting.Attachment.StoreType == storage.MinioStorageType { | if setting.Attachment.StoreType == storage.MinioStorageType { | ||||
| uuid = gouuid.NewV4().String() | |||||
| uuid := gouuid.NewV4().String() | |||||
| url, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid)) | url, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid)) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("PresignedPutURL", err) | ctx.ServerError("PresignedPutURL", err) | ||||
| return | return | ||||
| } | } | ||||
| log.Trace(url) | |||||
| ctx.JSON(200, map[string]string{ | |||||
| "uuid": uuid, | |||||
| "url": url, | |||||
| }) | |||||
| } else { | } else { | ||||
| ctx.Error(404, "storage type is not enabled") | ctx.Error(404, "storage type is not enabled") | ||||
| return | return | ||||
| } | } | ||||
| ctx.JSON(200, map[string]string{ | |||||
| "uuid": uuid, | |||||
| "url": url, | |||||
| }) | |||||
| } | } | ||||