style(update): Updated the styling amd layout to be much better!
This commit is contained in:
@@ -516,10 +516,39 @@ func (app *App) handleLegacyUpload(ctx *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
savedFiles := make([]models.BoxFile, 0, len(files))
|
||||
retentionKey := strings.TrimSpace(ctx.PostForm("retention_key"))
|
||||
if retentionKey == "" {
|
||||
retentionKey = strings.TrimSpace(ctx.PostForm("retention"))
|
||||
}
|
||||
allowZip := true
|
||||
if strings.EqualFold(strings.TrimSpace(ctx.PostForm("allow_zip")), "false") {
|
||||
allowZip = false
|
||||
}
|
||||
request := models.CreateBoxRequest{
|
||||
RetentionKey: retentionKey,
|
||||
Password: ctx.PostForm("password"),
|
||||
AllowZip: &allowZip,
|
||||
Files: make([]models.CreateBoxFileRequest, 0, len(files)),
|
||||
}
|
||||
for _, file := range files {
|
||||
savedFile, err := boxstore.SaveUpload(boxID, file)
|
||||
request.Files = append(request.Files, models.CreateBoxFileRequest{Name: file.Filename, Size: file.Size})
|
||||
}
|
||||
if err := app.validateCreateBoxRequest(&request); err != nil {
|
||||
ctx.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
manifestFiles, err := boxstore.CreateManifest(boxID, request)
|
||||
if err != nil {
|
||||
ctx.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
savedFiles := make([]models.BoxFile, 0, len(files))
|
||||
for index, file := range files {
|
||||
savedFile, err := boxstore.SaveManifestUpload(boxID, manifestFiles[index].ID, file)
|
||||
if err != nil {
|
||||
_, _ = boxstore.MarkFileStatus(boxID, manifestFiles[index].ID, models.FileStatusFailed)
|
||||
ctx.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user