mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-08-16 13:32:53 +02:00
「🏗️」 wip: work in progress, not done yet.
This commit is contained in:
@ -122,10 +122,12 @@ export default async function(fastify, options) {
|
||||
// POST
|
||||
fastify.post('/users/:userId', { preHandler: [fastify.authenticateAdmin] }, async (request, reply) => {
|
||||
try {
|
||||
const userId = request.params.userId;
|
||||
|
||||
if (getUserInfo.get(userId)) {
|
||||
return reply.code(400).send({ error: "User already exist" });
|
||||
}
|
||||
createUser.run(request.params.userId, request.params.userId);
|
||||
createUser.run(userId, userId);
|
||||
return reply.code(200).send({ msg: "User created sucessfully" });
|
||||
} catch (err) {
|
||||
fastify.log.error(err);
|
||||
|
Reference in New Issue
Block a user