working send request and such

This commit is contained in:
talksik
2022-03-20 16:53:01 -04:00
parent 795a15cc0f
commit 67fff95390
7 changed files with 109 additions and 11 deletions
+16 -2
View File
@@ -1,5 +1,8 @@
import { Db } from "mongodb";
import Relationship from "@nirvana/core/models/relationship.model";
import { Db, ObjectId } from "mongodb";
import Relationship, {
RelationshipState,
} from "@nirvana/core/models/relationship.model";
import { collections } from "./database.service";
export class ContactService {
@@ -50,4 +53,15 @@ export class ContactService {
return insertResult;
}
static async updateRelationshipState(
relationshipId: ObjectId,
newState: RelationshipState
) {
const query = { _id: relationshipId };
const updateDoc = { $set: { state: newState } };
const result = await collections.relationships?.updateOne(query, updateDoc);
return result;
}
}