diff --git a/packages/numbers/lib/numbers.ts b/packages/numbers/lib/numbers.ts index 86f788fe..bc302544 100644 --- a/packages/numbers/lib/numbers.ts +++ b/packages/numbers/lib/numbers.ts @@ -200,7 +200,7 @@ export class Numbers extends Client { * @param {NumbersSearchFilter} filter - The filter criteria for searching available numbers. * @return {Promise} A promise that resolves to a list of available phone numbers or an error response. * - * @example + * @example * Search for available numbers that can send SMS and make voice calls * ```ts * import { Country, Feature } from '@vonage/numbers'; @@ -306,8 +306,14 @@ export class Numbers extends Client { const resp = await this.sendFormSubmitRequest( `${this.config.restHost}/number/update`, { + country: params.country, + msisdn: params.msisdn, ...(appId ? { app_id: appId } : {}), - ...params, + moHttpUrl: params.moHttpUrl, + moSmppSysType: params.moSmppSysType, + voiceCallbackType: params.voiceCallbackType, + voiceCallbackValue: params.voiceCallbackValue, + voiceStatusCallback: params.voiceStatusCallback, }, ); diff --git a/packages/server-client/lib/client.ts b/packages/server-client/lib/client.ts index 82614d82..e47a3bb2 100644 --- a/packages/server-client/lib/client.ts +++ b/packages/server-client/lib/client.ts @@ -215,14 +215,14 @@ export class Client { */ async sendFormSubmitRequest( url: string, - payload?: Record, + payload?: Record, ): Promise> { const request = { url, method: HTTPMethods.POST, type: ContentType.FORM_URLENCODED, headers: { Accept: 'application/json' }, - ...(payload ? { data: payload } : {}), + ...JSON.parse(JSON.stringify((payload ? { data: payload } : {}))), } as VetchOptions; return await this.sendRequest(request);