diff --git a/src/WAConnection/5.User.ts b/src/WAConnection/5.User.ts index d8d4036..9d04c4f 100644 --- a/src/WAConnection/5.User.ts +++ b/src/WAConnection/5.User.ts @@ -1,5 +1,5 @@ import {WAConnection as Base} from './4.Events' -import { Presence, WABroadcastListInfo, WAProfilePictureChange, WALoadChatOptions, WAChatIndex, BlocklistUpdate } from './Constants' +import { Presence, WABroadcastListInfo, WAProfilePictureChange, WALoadChatOptions, WAChatIndex, BlocklistUpdate, WABusinessProfile } from './Constants' import { WAMessage, WANode, @@ -87,12 +87,13 @@ export class WAConnection extends Base { delete profile.business_hours.config } const json = ['action', "editBusinessProfile", {...profile, v: 2}] + let response; try { - const response = await this.query({ json, expect200: true, requiresPhoneConnection: true }).catch(_ => throw new Error(_)) + response = await this.query({ json, expect200: true, requiresPhoneConnection: true }) } catch (_) { return {status: 400} } - return {status: response.status} + return { status: response.status } } async updateProfileName (name: string) { const response = (await this.setQuery (