Skip to content

Commit

Permalink
fix: Fixed error on checkNumberStatus (#2225)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jun 18, 2024
1 parent fad702f commit 11210b3
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/api/layers/retriever.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,29 +183,11 @@ export class RetrieverLayer extends SenderLayer {
* @returns contact detial as promise
*/
public async checkNumberStatus(contactId: string): Promise<WhatsappProfile> {
const result = await evaluateAndReturn(
return await evaluateAndReturn(
this.page,
(contactId) => WPP.contact.queryExists(contactId),
(contactId) => WAPI.checkNumberStatus(contactId),
contactId
);

if (!result) {
return {
id: contactId as any,
isBusiness: false,
canReceiveMessage: false,
numberExists: false,
status: 404,
};
}

return {
id: result.wid as any,
isBusiness: result.biz,
canReceiveMessage: true,
numberExists: true,
status: 200,
};
}

/**
Expand Down

0 comments on commit 11210b3

Please sign in to comment.