Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jin-co committed Sep 11, 2023
1 parent 90d93a8 commit 956c623
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions React/test-housing/src/pages/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export const Profile = () => {
const listingRef = collection(db, 'listings')
const q = query(
listingRef,
where('userRef', '==', auth.currentUser.uid),
orderBy('timestamp', 'desc')
where('userRef', '==', auth.currentUser.uid)
)

const querySnap = await getDocs(q)
let listings = []

querySnap.forEach((doc) => {
console.log(doc)
return listings.push({
id: doc.id,
data: doc.data(),
Expand All @@ -48,9 +48,7 @@ export const Profile = () => {

const fetchListings = async () => {
const docRef = collection(db, 'listings')
console.log(docRef)
const docSnap = await getDocs(docRef)
console.log(docSnap)
const listings = []
docSnap.forEach(doc => {
listings.push({
Expand Down

0 comments on commit 956c623

Please sign in to comment.