Updated the make_user to use MongoDB
This commit is contained in:
@@ -44,6 +44,10 @@ export const getUserCorporate = async (id: string) => {
|
||||
return corporates.shift() as CorporateUser | MasterCorporateUser;
|
||||
};
|
||||
|
||||
export const getGroup = async (id: string) => {
|
||||
return await db.collection("groups").findOne<Group>({id});
|
||||
};
|
||||
|
||||
export const getGroups = async () => {
|
||||
return await db.collection("groups").find<Group>({}).toArray();
|
||||
};
|
||||
@@ -56,6 +60,10 @@ export const getUserGroups = async (id: string): Promise<Group[]> => {
|
||||
return await db.collection("groups").find<Group>({admin: id}).toArray();
|
||||
};
|
||||
|
||||
export const getUserNamedGroup = async (id: string, name: string) => {
|
||||
return await db.collection("groups").findOne<Group>({admin: id, name});
|
||||
};
|
||||
|
||||
export const getUsersGroups = async (ids: string[]) => {
|
||||
return await db
|
||||
.collection("groups")
|
||||
|
||||
Reference in New Issue
Block a user