diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 5aa6e6b20..62d29cf22 100644 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -263,6 +263,7 @@ func AddAttachment(ctx *context.Context) { UploaderID: ctx.User.ID, Name: ctx.Query("file_name"), Size: ctx.QueryInt64("size"), + DatasetID: ctx.QueryInt64("dataset_id"), }) if err != nil { diff --git a/web_src/js/index.js b/web_src/js/index.js index 79dbe5268..1575e2666 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2414,9 +2414,6 @@ $(document).ready(async () => { }); this.on('success', (file, data) => { var uuid = $dataset.data('uuid'); - console.log(uuid); - console.log(file.name); - console.log(file.size); filenameDict[file.name] = uuid; const input = $(``).val(uuid); $('.files').append(input); @@ -2425,6 +2422,7 @@ $(document).ready(async () => { uuid: uuid, file_name: file.name, size: file.size, + dataset_id: $dataset.data('dataset-id'), _csrf: $dataset.data('csrf') }); }