Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
334b64ca6d | ||
|
|
9dc505af17 |
4
main.go
4
main.go
@@ -145,7 +145,7 @@ func withDel(foo http.HandlerFunc) http.HandlerFunc {
|
|||||||
if len(match) > 0 {
|
if len(match) > 0 {
|
||||||
match = bytes.Split(match, []byte(`href="`))[1]
|
match = bytes.Split(match, []byte(`href="`))[1]
|
||||||
match = match[:len(match)-1]
|
match = match[:len(match)-1]
|
||||||
b[i] = []byte(fmt.Sprintf(`<a href="%s/%s"><input type="button" value="❌" style="padding: .40em 1em .10em 1em; margin-right: .5em"/></a> %s`, match, ENDPOINT_DELETE, b[i]))
|
b[i] = []byte(fmt.Sprintf(`<a href="%s/%s"><input type="button" value="❌" style="padding: .40em 1em .10em 1em; margin-right: .5em" onclick='return confirm("Delete "+%q+"?");'></input></a> %s`, match, ENDPOINT_DELETE, match, b[i]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buff.Write(b[i])
|
buff.Write(b[i])
|
||||||
@@ -189,7 +189,7 @@ func del(w http.ResponseWriter, r *http.Request) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = os.Remove(p)
|
err = os.RemoveAll(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
hi
|
|
||||||
Reference in New Issue
Block a user