Skip to content

Commit 2c0c70f

Browse files
authored
fix(utils): fix issue where congregation backup could not be retrieved
1 parent 4b290d6 commit 2c0c70f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/utils/congregation-request-utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { getFirestore } from "firebase-admin/firestore";
2-
import CongregationRequest from "../classes/CongregationRequest.js";
1+
import { getFirestore } from 'firebase-admin/firestore';
2+
import CongregationRequest from '../classes/CongregationRequest.js';
33

44
const db = getFirestore();
55

66
export const dbFetchRequestsCongregation = async () => {
7-
const congRef = db.collection("congregation_request");
7+
const congRef = db.collection('congregation_request');
88
const snapshot = await congRef.get();
99

1010
const items = [];
@@ -17,8 +17,8 @@ export const dbFetchRequestsCongregation = async () => {
1717

1818
let finalResult = [];
1919
for (let i = 0; i < items.length; i++) {
20-
const RequestClass = new CongregationRequest(items[i]);
21-
const request = await RequestClass.loadDetails();
20+
const request = new CongregationRequest(items[i]);
21+
await request.loadDetails();
2222
finalResult.push(request);
2323
}
2424

src/utils/congregation-utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { getFirestore } from "firebase-admin/firestore";
2-
import { Congregation } from "../classes/Congregation.js";
1+
import { getFirestore } from 'firebase-admin/firestore';
2+
import { Congregation } from '../classes/Congregation.js';
33

44
const db = getFirestore(); //get default database
55

66
export const dbFetchCongregations = async () => {
7-
const congRef = db.collection("congregations");
7+
const congRef = db.collection('congregations');
88
const snapshot = await congRef.get();
99

1010
const items = [];
@@ -16,8 +16,8 @@ export const dbFetchCongregations = async () => {
1616
const finalResult = [];
1717

1818
for (let i = 0; i < items.length; i++) {
19-
const CongClass = new Congregation(items[i]);
20-
const cong = await CongClass.loadDetails();
19+
const cong = new Congregation(items[i]);
20+
await cong.loadDetails();
2121
finalResult.push(cong);
2222
}
2323

0 commit comments

Comments
 (0)