From 7a845af78cc658e16fe2b28251ddf6b19aea8948 Mon Sep 17 00:00:00 2001 From: Alen Yohannan <66544823+AlenSaito1@users.noreply.github.com> Date: Sat, 5 Jun 2021 16:40:27 +0530 Subject: [PATCH] Fix errors with Compilation (#515) There were some erros which prevented the code to compile. This commit fixes that --- src/WAConnection/5.User.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 (