aboutsummaryrefslogtreecommitdiff
path: root/bot/src/api/routes/blacklist.js
blob: ffcd60bf795059940f4638d07d68b2cfa7d52a7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Router } from 'express';

export function authRouter() {
    const router = Router();

    router.post('/blacklist/guild/add', async (req, res) => {
        const { guildID } = req.body;
        try {
            res.status(200).send({ message: 'Added to the blacklist' });
        } catch (error) {
            console.error('Something went wrong:', error);
            res.status(500).send({ message: 'Internal Server Error' });
        }
    });

    router.post('/blacklist/user/add', async (req, res) => {
        const { userID } = req.body;
        try {
            res.status(200).send({ message: 'Added to the blacklist' });
        } catch (error) {
            console.error('Something went wrong:', error);
            res.status(500).send({ message: 'Internal Server Error' });
        }
    });

    router.post('/blacklist/guild/remove', async (req, res) => {
        const { guildID } = req.body;
        try {
            res.status(200).send({ message: 'Removed from the blacklist' });
        } catch (error) {
            console.error('Something went wrong:', error);
            res.status(500).send({ message: 'Internal Server Error' });
        }
    });

    router.post('/blacklist/user/remove', async (req, res) => {
        const { userID } = req.body;
        try {
            res.status(200).send({ message: 'Removed from the blacklist' });
        } catch (error) {
            console.error('Something went wrong:', error);
            res.status(500).send({ message: 'Internal Server Error' });
        }
    });

    return router;
}