Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jhowbhz committed Sep 23, 2023
1 parent 92eaeb2 commit 8c416bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/controllers/SCController.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class SCController {
const html = await pageReload.content();
if (html.includes(textoNotFound)) {
await pageReload.close();
await browser.close();
return { placa, renavam, multas: [], message: 'Nenhuma multa em aberto cadastrada para este veículo até o momento.' };
}
if (html.includes(textCaptchaInvalid)) {
Expand Down Expand Up @@ -147,6 +148,7 @@ class SCController {
multas.shift();
await pageReload.close();
await browser.close();
console.log(multas);
return { placa, renavam, multas };
}
catch (e) {
Expand Down
5 changes: 5 additions & 0 deletions src/controllers/SCController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ class SCController {
const html = await pageReload.content();

if (html.includes(textoNotFound)) {

await pageReload.close();
await browser.close();

return { placa, renavam, multas: [], message: 'Nenhuma multa em aberto cadastrada para este veículo até o momento.' };
}

Expand Down Expand Up @@ -167,6 +170,8 @@ class SCController {
await pageReload.close();
await browser.close();

console.log(multas);

return { placa, renavam, multas };

}catch(e){
Expand Down

0 comments on commit 8c416bd

Please sign in to comment.