Fix errors with Compilation (#515)

There were some erros which prevented the code to compile. This commit fixes that
This commit is contained in:
Alen Yohannan
2021-06-05 16:40:27 +05:30
committed by GitHub
parent ff69726ec4
commit 7a845af78c

View File

@@ -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 (