import DBDefenses from '../../types/db/DBDefenses';
import { Defenses } from '../db/mongodb';

export const getAllDefenses = async () => {
    return (await Defenses()).find({}).toArray() as unknown as Array<DBDefenses>;   
}

export const getDefenseById = async (id: string) => {
    return (await Defenses()).findOne({
        id
    }) as unknown as DBDefenses;
}