import { getCollection } from "../mongodb";

export type User = {
    _id: string;
    name: string;
    role: number;
    account: string;
    password: string;
}
export async function getUser(account: string) {
    const collection = await getCollection('user')
    const user = await collection.findOne<User>({ account })

    return user
}