diff --git a/src/backend/APIs/firebase_api/index.js b/src/backend/APIs/firebase_api/index.js index 902cd51..9e6b07d 100644 --- a/src/backend/APIs/firebase_api/index.js +++ b/src/backend/APIs/firebase_api/index.js @@ -651,9 +651,12 @@ class FirebaseAPI{ try { let titleResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/baslik`).get(); let descriptionResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/description`).get(); + let dateResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/bitisTarihi`).get(); + return { title: titleResult.val(), - description: descriptionResult.val() + description: descriptionResult.val(), + date: dateResult.val() } } catch (error) { return {data: undefined, error: error} diff --git a/src/components/cuz/Cuzler/index.js b/src/components/cuz/Cuzler/index.js index 78c1331..d830b15 100644 --- a/src/components/cuz/Cuzler/index.js +++ b/src/components/cuz/Cuzler/index.js @@ -158,6 +158,7 @@ const Question = ({ toggle }) => { const [cuzlerHatimCardTitle, setCuzlerHatimCardTitle] = useState("") const [cuzlerHatimCardDescription, setCuzlerHatimCardDescription] = useState("") + const [cuzlerHatimCardDate, setCuzlerHatimCardDate] = useState("") /** CuzlerHatimCard End */ @@ -204,10 +205,11 @@ const Question = ({ toggle }) => { return; } - const {title, description} = await database.getTitleAndDescription({subKey: Object.values(result.khatmSubKeys)[0]}); + const {title, description, date} = await database.getTitleAndDescription({subKey: Object.values(result.khatmSubKeys)[0]}); setCuzlerHatimCardTitle(title) setCuzlerHatimCardDescription(description) + setCuzlerHatimCardDate(date) // console.log(result.khatmSubKeys) setKhatmSubKeys(result.khatmSubKeys); @@ -530,7 +532,7 @@ const Question = ({ toggle }) => { { hatim.subKey == currentKhatmSubKey)[0].bitisTarihi.split("-").reverse().join("/")} + duaLeftDays={cuzlerHatimCardDate.split("-").reverse().join("/")} yesHandler={yesHandlerState} toggleYesHandler={toggleYesHandlerState} noHandler={noHandlerState} toggleNoHandler={toggleNoHandlerState}