mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
parent
a20d85d451
commit
9189c79d74
@ -153,6 +153,8 @@ func (c *configMuxBuilder) registerFolder(path string) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
c.Handle(http.MethodDelete, path, func(w http.ResponseWriter, _ *http.Request, p httprouter.Params) {
|
c.Handle(http.MethodDelete, path, func(w http.ResponseWriter, _ *http.Request, p httprouter.Params) {
|
||||||
|
c.mut.Lock()
|
||||||
|
defer c.mut.Unlock()
|
||||||
waiter, err := c.cfg.RemoveFolder(p.ByName("id"))
|
waiter, err := c.cfg.RemoveFolder(p.ByName("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
@ -194,6 +196,8 @@ func (c *configMuxBuilder) registerDevice(path string) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
c.Handle(http.MethodDelete, path, func(w http.ResponseWriter, _ *http.Request, p httprouter.Params) {
|
c.Handle(http.MethodDelete, path, func(w http.ResponseWriter, _ *http.Request, p httprouter.Params) {
|
||||||
|
c.mut.Lock()
|
||||||
|
defer c.mut.Unlock()
|
||||||
id, err := protocol.DeviceIDFromString(p.ByName("id"))
|
id, err := protocol.DeviceIDFromString(p.ByName("id"))
|
||||||
waiter, err := c.cfg.RemoveDevice(id)
|
waiter, err := c.cfg.RemoveDevice(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user