You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
647 B
26 lines
647 B
2 years ago
|
import queues from "../lib/queues.js";
|
||
|
import { API } from "../lib/api.js";
|
||
|
import logging from "../lib/logging.js";
|
||
|
|
||
|
const log = logging.create(import.meta.url);
|
||
|
|
||
|
export const get = async (req, res) => {
|
||
|
const api = new API(req, res);
|
||
|
api.reply(200, { discord_sent: api.req.user.discord_sent });
|
||
|
}
|
||
|
|
||
|
get.authenticated = true;
|
||
|
|
||
|
export const post = async (req, res) => {
|
||
|
const api = new API(req, res);
|
||
|
|
||
|
log.debug(`Discord request received from user ${ req.user.id }`);
|
||
|
const discord_q = queues.create("discord/send_invite");
|
||
|
|
||
|
discord_q.add({user_id: api.req.user.id});
|
||
|
|
||
|
api.reply(200, { message: "OK" });
|
||
|
}
|
||
|
|
||
|
post.authenticated = true;
|