All files / src/controllers/system-controller loggedAdmin.js

50% Statements 2/4
100% Branches 0/0
100% Functions 1/1
50% Lines 2/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11      1x 1x            
import AdminModel from '../../models/Admins.js';
 
export default async function loggedAdmin(adminId) {
    try {
        return await AdminModel.findById(adminId, { avatar: 1, adminName: 1, adminEmail: 1 });
    } catch (error) {
        console.log(error)
        return;
    }
}