feat: add balance endpoint to messagebird

This commit is contained in:
Jefiozie
2020-12-23 08:51:07 +01:00
parent 0f0e67eb30
commit c922163622
2 changed files with 42 additions and 7 deletions

View File

@@ -43,8 +43,10 @@ export async function messageBirdApiRequest(
uri: `https://rest.messagebird.com${resource}`,
json: true,
};
try {
if (Object.keys(body).length === 0) {
delete options.body;
}
return await this.helpers.request(options);
} catch (error) {
if (error.statusCode === 401) {