working displaying contacts, but of course not nice

This commit is contained in:
talksik
2022-03-20 18:24:50 -04:00
parent b491eee62c
commit b9f93d741d
5 changed files with 102 additions and 6 deletions
+11
View File
@@ -6,6 +6,17 @@ import Relationship, {
import { collections } from "./database.service";
export class ContactService {
static async getAllUserRelationships(userId: string) {
const query = {
$or: [{ senderUserId: userId }, { receiverUserId: userId }],
};
const res = (await collections.relationships
?.find(query)
.toArray()) as Relationship[];
return res;
}
static async getRelationship(
myGoogleUserId: string,
otherGoogleUserId: string