mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-31 10:40:10 +02:00
return the doc promise
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user