Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Govt-Billing-React/src/firebase/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ const downloadFileFromFirebase = async (userId, key, onSuccess) => {
const local = new Local();
const getFile = async () => {
const docSnapshot = await getDoc(doc(db, "invoices", `${userId}-${key}`));
if (!docSnapshot.exists()) {
throw new Error("File not found on the server. It may have been deleted.");
}
const data = docSnapshot.data();
delete data["owner"];
return data;
Expand Down