try to save data while onResponse

This commit is contained in:
Lei PAN
2023-04-20 19:32:11 +02:00
parent 66209894d6
commit 087a847d98
2 changed files with 11 additions and 10 deletions
+11 -6
View File
@@ -418,16 +418,21 @@ class CommandorPage {
}
async onResponse(response) {
// let rex = new RegExp(REGEX_RDV_URL)
// log("onResponse with url:" + response.url())
// if (rex.test(response.url())) {
// log("rdv url found:" + response.url())
// await this.push_message_to_db(PublishType.SUCCESS, response.url())
// }
let rex = new RegExp(REGEX_RDV_URL)
log("onResponse with url:" + response.url())
// log("onResponse with url:" + response.body())
if (rex.test(response.url())) {
log("rdv url found:" + response.url())
await this.push_message_to_db(PublishType.SUCCESS, response.url())
}
}
async push_message_to_queue(publishType) {
let url = this.page.url();
await this.push_message_to_db(publishType, url)
}
async push_message_to_db(publishType, url) {
let splitedUrl = url.split("/");
let id = splitedUrl[splitedUrl.length - 1];
if (url === "https://rendezvousparis.hermes.com/client/welcome") {