Keep attachments on tasklist update #16750

Merged
KN4CK3R merged 5 commits from fix-16746 into main 2021-08-20 19:26:20 +00:00
KN4CK3R commented 2021-08-20 11:44:07 +00:00 (Migrated from github.com)

fixes #16746

An alternative (better?) solution may be an ignoreAttachments parameter.

await $.post(updateUrl, {
  _csrf: window.config.csrf,
  content: newContent,
  context,
  ignoreAttachments: true
});
if !ctx.FormBool("ignoreAttachments") {
	if err := updateAttachments(comment, ctx.FormStrings("files[]")); err != nil {
		ctx.ServerError("UpdateAttachments", err)
		return
	}
}
fixes #16746 An alternative (better?) solution may be an `ignoreAttachments` parameter. ```js await $.post(updateUrl, { _csrf: window.config.csrf, content: newContent, context, ignoreAttachments: true }); ``` ```go if !ctx.FormBool("ignoreAttachments") { if err := updateAttachments(comment, ctx.FormStrings("files[]")); err != nil { ctx.ServerError("UpdateAttachments", err) return } } ```
lunny approved these changes 2021-08-20 15:39:17 +00:00
zeripath reviewed 2021-08-20 16:29:07 +00:00
Contributor
	if ctx.FormString("action") == "ignoreAttachments" {
```suggestion if ctx.FormString("action") == "ignoreAttachments" { ```
Contributor
            action: 'ignoreAttachments',
```suggestion action: 'ignoreAttachments', ```
zeripath approved these changes 2021-08-20 17:39:03 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#16750
No description provided.