How to optimize if.else nesting

if(info.type === "add") {

    cate === "A" ?
        // add A
        : cate === "B" ?
        // add B
            : null;

} else if(info.type === "update") {

    cate === "A" ?
        // update A
        : cate === "B" ?
            // update B 
            : null

}

is similar to this. if.else is used on the outside. Inside is a ternary expression. Is there a clear solution?
is there a way to optimize this nesting of multiple judgments?

Feb.27,2021

to be clear, I think the original program is clearer. If you take a look at your program upstairs, you can only say that it has reduced the amount of code, or reduced the sentences related to logical judgment! Clear? Hehe


switch(`${info.type}_${cate}`) {
    case 'add_A': ..
    ...
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b9b626-2f295.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b9b626-2f295.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?