/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
examples/with-firebase/fetchData/getProfileData.js
13 строк
328 B
Steven
chore(examples): use default prettier for examples/templates (#60530)
12 янв 2024, 02:01
Не верифицирован
12 янв 2024, 02:01
4466ba4
Код
Авторство
О чём код?
import admin from "../firebase/nodeApp"; export const getProfileData = async (username) => { const db = admin.firestore(); const profileCollection = db.collection("profile"); const profileDoc = await profileCollection.doc(username).get(); if (!profileDoc.exists) { return null; } return profileDoc.data(); };