---
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { firebaseFirestore } from "../../firebase"
|
||||
export const getTourneyInfo = async (id) => {
|
||||
const tournamentsRef = firebaseFirestore.collection('tournaments').doc(id)
|
||||
const tournamentData = await tournamentsRef.get();
|
||||
if (tournamentData.exists == false) {
|
||||
return {}
|
||||
}
|
||||
else {
|
||||
const name = tournamentData.data().name
|
||||
const year = tournamentData.data().year
|
||||
const format = tournamentData.data().format
|
||||
return {
|
||||
name,
|
||||
year,
|
||||
format
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user