setting up workspaces structure, but not moving files

This commit is contained in:
Arjun Patel
2022-01-28 14:08:04 -08:00
parent 7f2ed61b4a
commit a3e6f7cf5e
258 changed files with 16 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import {
addDoc,
collection,
doc,
Firestore,
getFirestore,
serverTimestamp,
setDoc,
} from "firebase/firestore";
import Link, { LinkState } from "../models/link";
import { Collections } from "./collections";
export class LinkService {
private db: Firestore = getFirestore();
async updateLinkState(linkId: string, newState: LinkState) {
const docRef = doc(this.db, Collections.links, linkId);
await setDoc(
docRef,
{ state: newState, lastUpdatedDate: serverTimestamp() },
{ merge: true }
);
}
}