Reorder API endpoints to prevent clashing

This commit is contained in:
Mark Veidemanis 2022-08-18 07:20:30 +01:00
parent f4225b622f
commit e64aaf99d8
1 changed files with 19 additions and 19 deletions

View File

@ -194,25 +194,6 @@ class API(object):
} }
return dumps(networks) return dumps(networks)
@app.route("/irc/network/<net>/", methods=["POST"])
@login_required
def irc_network(self, request, net):
if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."})
inst = main.network[net]
network = {}
network["net"] = inst.net
network["auth"] = inst.auth
network["host"] = inst.host
network["last"] = inst.last
network["port"] = inst.port
network["security"] = inst.security
network["relays"] = len(inst.relays)
network["chanlimit"] = inst.chanlimit
network["channels"] = userinfo.getTotalChanNum(net)
network["records"] = userinfo.getNumWhoEntries(net)
return dumps(network)
@app.route("/irc/network/auth/", methods=["POST"]) @app.route("/irc/network/auth/", methods=["POST"])
@login_required @login_required
def irc_network_recheckauth(self, request): def irc_network_recheckauth(self, request):
@ -249,6 +230,25 @@ class API(object):
regproc.registerAccount(conn.net, conn.num) regproc.registerAccount(conn.net, conn.num)
return dumps({"success": True}) return dumps({"success": True})
@app.route("/irc/network/<net>/", methods=["POST"])
@login_required
def irc_network(self, request, net):
if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."})
inst = main.network[net]
network = {}
network["net"] = inst.net
network["auth"] = inst.auth
network["host"] = inst.host
network["last"] = inst.last
network["port"] = inst.port
network["security"] = inst.security
network["relays"] = len(inst.relays)
network["chanlimit"] = inst.chanlimit
network["channels"] = userinfo.getTotalChanNum(net)
network["records"] = userinfo.getNumWhoEntries(net)
return dumps(network)
@app.route("/irc/network/<net>/", methods=["DELETE"]) @app.route("/irc/network/<net>/", methods=["DELETE"])
@login_required @login_required
def irc_network_delete(self, request, net): def irc_network_delete(self, request, net):