You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
368 B
JavaScript
18 lines
368 B
JavaScript
import db from "@/firebase";
|
|
import { collection, getDocs } from "firebase/firestore";
|
|
|
|
async function getAllUsers() {
|
|
const usersCollcetion = collection(db, 'users')
|
|
const users = await getDocs(usersCollcetion)
|
|
const usersList = users.docs.map(doc => {
|
|
return {
|
|
...doc.data(),
|
|
id: doc.id
|
|
}
|
|
})
|
|
return usersList
|
|
}
|
|
|
|
export {
|
|
getAllUsers
|
|
} |