From 4c8b584ef43466efca2b703db256684d1c4f8885 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 2 Aug 2022 09:01:34 +0100 Subject: [PATCH] Implement deleting networks --- api/views.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/views.py b/api/views.py index 76abaa4..22bd866 100644 --- a/api/views.py +++ b/api/views.py @@ -211,6 +211,16 @@ class API(object): network["records"] = userinfo.getNumWhoEntries(net) return dumps(network) + @app.route("/irc/network//", methods=["DELETE"]) + @login_required + def irc_network_delete(self, request, net): + if net not in main.network.keys(): + return dumps({"success": False, "reason": "no such net."}) + main.network[net].seppuku() + del main.network[net] + main.saveConf("network") + return dumps({"success": True}) + @app.route("/irc/network//edit/", methods=["POST"]) @login_required def irc_network_edit(self, request, net):