aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes/user/userGET.js
blob: 7929aacf94259f693f698cfcbdbe1fb33feabdae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const Route = require('../../structures/Route');

class usersGET extends Route {
	constructor() {
		super('/users/me', 'get');
	}

	run(req, res, db, user) {
		return res.json({
			message: 'Successfully retrieved user',
			user: {
				id: user.id,
				username: user.username,
				isAdmin: user.isAdmin,
				apiKey: user.apiKey
			}
		});
	}
}

module.exports = usersGET;