Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dsTw5 authored Oct 11, 2023
1 parent 5f29f13 commit 3423499
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions listNumbers/functions/list_numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ exports.handler = async function (context, event, callback) {
const authToken = process.env.AUTH_TOKEN;
const subAccount = event.subAcc;
const password = event.pass;
const pageSize = event.pageSize;
const page = event.page;
const client = require("twilio")(accountSid, authToken, {
accountSid: subAccount,
});
const pageToken = event.pageToken;

const response = new Twilio.Response();

if (password !== process.env.Password) {
finalData = { er: 0 };
return callback(null, finalData);
} else if (pageSize > 0) {
} else if (event.pageSize > 0) {
pageResp = await client.incomingPhoneNumbers.page({
pageSize: pageSize,
Page: page,
pageToken: pageToken,
pageSize: event.pageSize,
Page: event.page,
pageToken: event.pageToken,
});

return callback(null, pageResp);
Expand Down

0 comments on commit 3423499

Please sign in to comment.