1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-04-22 11:44:28 +02:00

return the doc promise

This commit is contained in:
Kushagra Gour 2024-06-20 19:20:52 +05:30
parent b9fbccf513
commit c2420cccd9

View File

@ -125,7 +125,7 @@ function getArrayFromQuerySnapshot(querySnapshot) {
}
async function fetchItem(itemId) {
getDoc(doc(db, `items/${itemId}`)).then(doc => {
return getDoc(doc(db, `items/${itemId}`)).then(doc => {
if (!doc.exists) return {};
const data = doc.data();
return data;