creating link successfully

This commit is contained in:
Arjun Patel
2022-01-18 18:17:50 -08:00
parent bbe2e5a7cd
commit 1e3f4d6041
5 changed files with 49 additions and 17 deletions
+1 -1
View File
@@ -7,5 +7,5 @@ export enum Collections {
rooms = "rooms",
announcements = "announcements",
attachments = "attachments",
links = "links",
}
+8
View File
@@ -5,6 +5,7 @@ import {
getFirestore,
serverTimestamp,
} from "firebase/firestore";
import Link from "../models/link";
import { Message } from "../models/message";
import { Collections } from "./collections";
@@ -23,4 +24,11 @@ export class SendService {
}
);
}
async sendLink(link: Link) {
await addDoc(collection(this.db, Collections.links), {
...link,
createdDate: serverTimestamp(),
});
}
}