async function removeRole() {
    const roles = await db.findAllRoles();

    const roleChoices = roles.map(({ id, title }) => ({
        name: title,
        value: id
    }));

    const { roleId } = await prompt([
        {
            type: "list",
            name: "roleId",
            message:
                "Which role do you want to remove? (Warning: This will also remove employees)",
            choices: roleChoices
        }
    ]);

    await db.removeRole(roleId);

    console.log("Removed role from the database");

    startDB();
}
//removing a role in the company no longer needed
removing a role in the company no longer needed
removing a role in the company no longer needed
async function removeRole() {
    const roles = await db.findAllRoles();
    const roleChoices = roles.map(({ id, title }) => ({
        name: title,
        value: id
    }));
    const { roleId } = await prompt([
        {
            type: "list",
            name: "roleId",
            message:
                "Which role do you want to remove? (Warning: This will also remove employees)",
            choices: roleChoices
        }
    ]);
    await db.removeRole(roleId);
    console.log("Removed role from the database");
    startDB();
}
async function removeRole ( ) { const roles = await db . findAllRoles ( ) ; const roleChoices = roles . map ( ( { id , title } ) => ( { name : title , value : id } ) ) ; const { roleId } = await prompt ( [ { type : "list" , name : "roleId" , message : "Which role do you want to remove? (Warning: This will also remove employees)" , choices : roleChoices } ] ) ; await db . removeRole ( roleId ) ; console . log ( "Removed role from the database" ) ; startDB ( ) ; }
removing a role in the company no longer needed
removing a role in the company no longer needed