import { Request, Response } from "express";

import { RoleService } from "./role.service";

const roleService = new RoleService();

export class RoleController {

    async getAll(
        req:Request,
        res:Response
    ){
        const roles = 
        await roleService.getAll();
        res.json(roles);
    }

    async create(

        req:Request,
        res:Response
    ){
        const role =
        await roleService.create(
            req.body
        );

        res.status(201).json(role);
    }
}