import { FastifyInstance } from 'fastify';
import * as controller from './user.controller';

async function userRoutes(fastify: FastifyInstance) {
    fastify.get('/me',controller.getMe);
    fastify.post("/login", controller.login);
    fastify.get('/users', controller.getAllUsers);
    fastify.post('/users', { bodyLimit: 1024 * 1024 * 50 }, controller.createUser);
    fastify.get('/users/:id', controller.getUser);
    fastify.put('/users/:id', { bodyLimit: 1024 * 1024 * 50 }, controller.updateUser);
    fastify.delete('/users/:id', controller.deleteUser);
    fastify.get('/users/:id/integration', controller.getIntegrationStatus);
    fastify.delete('/users/:id/integration', controller.disconnectAniList);
    fastify.put('/users/:id/password', controller.changePassword);
}

export default userRoutes;