Skip to content

Commit 2fed14b

Browse files
Upgraded developer-sdk and developer-cli
1 parent d20126b commit 2fed14b

File tree

4 files changed

+451
-104
lines changed

4 files changed

+451
-104
lines changed

hooks/app/useDeveloperApp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { useEffect, useState } from 'react'
22
import { DeveloperApp, DeveloperAppConfig } from '@livechat/developer-sdk'
33
import lcConfig from '../../livechat.config.json'
44

5-
const config = lcConfig as DeveloperAppConfig
5+
const config = lcConfig as unknown as DeveloperAppConfig
66

77
function useDeveloperApp() {
88
const [developerApp, setDeveloperApp] = useState<DeveloperApp | null>(null)
99

1010
useEffect(() => {
1111
const app = DeveloperApp.init(config)
1212

13-
if (config.auth?.clientId) {
13+
if (config.blocks?.authorization) {
1414
app.authorize().then(() => setDeveloperApp(app))
1515
} else {
1616
setDeveloperApp(app)

lib/api/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const fetchCustomers = async (developerApp: DeveloperApp) => {
88
const response = await fetch(`${developerApp.urls.liveChatApi}/configuration/action/list_properties`, {
99
method: 'POST',
1010
body: JSON.stringify({
11-
owner_client_id: (lcConfig as DeveloperAppConfig).auth?.clientId,
11+
owner_client_id: (lcConfig as unknown as DeveloperAppConfig).blocks?.authorization?.clientId,
1212
}),
1313
headers: {
1414
'Content-Type': 'application/json',
@@ -30,7 +30,7 @@ export const saveCustomerProfile = async (developerApp: DeveloperApp, customerPr
3030
method: 'POST',
3131
body: JSON.stringify({
3232
name: customerProfile.id,
33-
owner_client_id: (lcConfig as DeveloperAppConfig).auth?.clientId,
33+
owner_client_id: (lcConfig as unknown as DeveloperAppConfig).blocks?.authorization?.clientId,
3434
type: 'string',
3535
access: {
3636
license: {
@@ -59,7 +59,7 @@ export const deleteCustomerProfile = async (developerApp: DeveloperApp, id: stri
5959
method: 'POST',
6060
body: JSON.stringify({
6161
name: id,
62-
owner_client_id: (lcConfig as DeveloperAppConfig).auth?.clientId,
62+
owner_client_id: (lcConfig as unknown as DeveloperAppConfig).blocks?.authorization?.clientId,
6363
}),
6464
headers: {
6565
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)