Mercurial Hosting > disearch
comparison src/delete_server.js.luan @ 13:af2b95854072
add server records
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 30 Oct 2023 21:32:42 -0600 |
parents | |
children | 80105b716a62 |
comparison
equal
deleted
inserted
replaced
12:3e2cb946d511 | 13:af2b95854072 |
---|---|
1 local Luan = require "luan:Luan.luan" | |
2 local error = Luan.error | |
3 local Io = require "luan:Io.luan" | |
4 local Http = require "luan:http/Http.luan" | |
5 local Server = require "site:/lib/Server.luan" | |
6 local Utils = require "site:/lib/Utils.luan" | |
7 local get_user = Utils.get_user or error() | |
8 | |
9 | |
10 return function() | |
11 local server_id = Http.request.parameters.server or error() | |
12 local server = Server.get_by_id(server_id) | |
13 server.owner_discord_id == get_user() or error() | |
14 server.delete() | |
15 Io.stdout = Http.response.text_writer() | |
16 %> | |
17 location.reload(); | |
18 <% | |
19 end |