12 lines
364 B
TypeScript
12 lines
364 B
TypeScript
import DBResearch from '../../types/DBResearch';
|
|
import { Research } from '../db/mongodb';
|
|
|
|
export const getAllResearch = async () => {
|
|
return (await Research()).find({}).toArray() as unknown as Array<DBResearch>;
|
|
}
|
|
|
|
export const getResearchById = async (id: string) => {
|
|
return (await Research()).findOne({
|
|
id
|
|
}) as unknown as DBResearch;
|
|
} |