creating rooms fine, but not displaying them yet
This commit is contained in:
@@ -4,4 +4,8 @@ export enum Collections {
|
||||
teamMembers = "teamMembers",
|
||||
teamSubscriptions = "teamSubscriptions",
|
||||
audioMessages = "audioMessages",
|
||||
|
||||
rooms = "rooms",
|
||||
announcements = "announcements",
|
||||
attachments = "attachments",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import {
|
||||
addDoc,
|
||||
collection,
|
||||
doc,
|
||||
Firestore,
|
||||
getFirestore,
|
||||
serverTimestamp,
|
||||
} from "firebase/firestore";
|
||||
import Room from "../models/room";
|
||||
import { Collections } from "./collections";
|
||||
|
||||
export default class RoomService {
|
||||
private db: Firestore = getFirestore();
|
||||
|
||||
async createRoom(room: Room) {
|
||||
const roomDocRef = await addDoc(collection(this.db, Collections.rooms), {
|
||||
...room,
|
||||
createdDate: serverTimestamp(),
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user