import DBResource from '../../types/db/DBResource';
import { Resources } from '../db/mongodb';

export const getAllResources = async () => {
    return (await Resources()).find({}).toArray() as unknown as Array<DBResource>;   
}

export const getResourceById = async (id: string) => {
    return (await Resources()).findOne({
        id
    }) as unknown as DBResource;
}