1 time login only

This commit is contained in:
tuanvu
2025-12-09 15:41:47 +01:00
parent 5550f0b9dd
commit 162fcdee4c
2 changed files with 8 additions and 12 deletions

View File

@@ -38,11 +38,12 @@ export async function getRessources(): Promise<Ressources[]> {
}
export async function getChantiers(): Promise<Chantier[]> {
const snap = await getDocs(collection(db, "chantiers"));
const snap = await getDocs(collection(db, "chantier"));
const chantiers: Chantier[] = [];
for (const docSnap of snap.docs) {
const data = docSnap.data();
//Faut convertir les Timestamp en Date ( merci à firebase :) )
const dateDep = data.dateDep instanceof Timestamp ? data.dateDep.toDate() : new Date(data.dateDep);
let chef: User | null = null;
if (data.chef) {