diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index 557194a..c4b65c8 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -528,6 +528,22 @@ class CommandorPage { console.log("will click on valid button"); console.log("isTerminated is " + this.isTerminated); if (!this.isTerminated) { + let raw = await this.getRawAppointmentInfo(this.page) + if (raw.email !== undefined) { + this.contact.mail = raw.email + } + if (raw.passportNumber !== undefined) { + this.contact.passportNumber = raw.passportNumber + } + if (raw.lastName !== undefined) { + this.contact.lastName = raw.lastName + } + if (raw.phoneNumber !== undefined) { + this.contact.phoneNumber = raw.phoneNumber + } + if (raw.firstName !== undefined) { + this.contact.firstName = raw.firstName + } await this.page.evaluate(() => { document.getElementsByClassName("btn")[0].click(); }) @@ -684,23 +700,6 @@ class CommandorPage { return } // save to mongoDb - let raw = await this.getRawAppointmentInfo(this.page) - // await this.mongoManager.saveRawReserveInfoToDb(raw) - if (raw.email !== undefined) { - this.contact.mail = raw.email - } - if (raw.passportNumber !== undefined) { - this.contact.passportNumber = raw.passportNumber - } - if (raw.lastName !== undefined) { - this.contact.lastName = raw.lastName - } - if (raw.phoneNumber !== undefined) { - this.contact.phoneNumber = raw.phoneNumber - } - if (raw.firstName !== undefined) { - this.contact.firstName = raw.firstName - } let reserve = ReserveResultPojo.create_from_contact(this.contact, id, url, this.choosedStore, publishType); reserve.source_from = this.device.model(); await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict())