adjustments to add team role and other better stuff

This commit is contained in:
Arjun Patel
2022-01-15 13:52:44 -08:00
parent 87fb480956
commit 74f8c40e45
6 changed files with 95 additions and 58 deletions
+9
View File
@@ -52,6 +52,15 @@ export default class TeamService implements IService {
return teamDocRef.id;
}
async updateTeam(team: Team) {
const docRef = doc(this.db, Collections.teams, team.id);
await setDoc(
docRef,
{ ...team, lastUpdatedDate: serverTimestamp() },
{ merge: true }
);
}
async getTeam(teamId: string): Promise<Team | null> {
const docRef = doc(this.db, Collections.teams, teamId);
const docSnap = await getDoc(docRef);