mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-23 04:52:40 +00:00
Fix naming file on edit
This commit is contained in:
parent
f49f4ca10d
commit
31ea2f650b
1 changed files with 3 additions and 1 deletions
|
@ -209,12 +209,14 @@ func processCreate(ctx echo.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
dto.Files = make([]models.FileDTO, 0)
|
dto.Files = make([]models.FileDTO, 0)
|
||||||
|
fileCounter := 0
|
||||||
for i := 0; i < len(ctx.Request().PostForm["content"]); i++ {
|
for i := 0; i < len(ctx.Request().PostForm["content"]); i++ {
|
||||||
name := ctx.Request().PostForm["name"][i]
|
name := ctx.Request().PostForm["name"][i]
|
||||||
content := ctx.Request().PostForm["content"][i]
|
content := ctx.Request().PostForm["content"][i]
|
||||||
|
|
||||||
if name == "" {
|
if name == "" {
|
||||||
name = "gistfile" + strconv.Itoa(i+1) + ".txt"
|
fileCounter += 1
|
||||||
|
name = "gistfile" + strconv.Itoa(fileCounter) + ".txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
escapedValue, err := url.QueryUnescape(content)
|
escapedValue, err := url.QueryUnescape(content)
|
||||||
|
|
Loading…
Reference in a new issue