Adjust telegram service expected error shape (#484)

Signed-off-by: Ilya Sumbatyants <ilya.sumb@gmail.com>
This commit is contained in:
Ilya Sumbatyants
2021-12-02 10:03:16 +01:00
committed by GitHub
parent c60388224b
commit fa6b390c01
4 changed files with 15 additions and 17 deletions
@@ -13,15 +13,13 @@
// limitations under the License.
-->
<script lang="ts">
import type { Ref, Space } from '@anticrm/core';
import { getMetadata } from '@anticrm/platform';
import login from '@anticrm/login'
import { getCurrentAccount, Ref, Space } from '@anticrm/core';
import { createQuery } from '@anticrm/presentation'
import setting from '@anticrm/setting'
import type { Integration, IntegrationType } from '@anticrm/setting'
import PluginCard from './PluginCard.svelte'
const accountId = getMetadata(login.metadata.LoginEmail)
const accountId = getCurrentAccount()._id
const typeQuery = createQuery()
const integrationQuery = createQuery()
@@ -29,7 +27,7 @@
let integrationTypes: IntegrationType[] = []
typeQuery.query(setting.class.IntegrationType, {}, (res) => (integrationTypes = res))
integrationQuery.query(setting.class.Integration, { space: accountId as Ref<Space> }, (res) => (integrations = res))
integrationQuery.query(setting.class.Integration, { space: accountId as string as Ref<Space> }, (res) => (integrations = res))
</script>
<div class="cards-container">
@@ -14,23 +14,22 @@
-->
<script lang="ts">
import { Button, Component, Label, Link } from '@anticrm/ui'
import { getMetadata, getResource } from '@anticrm/platform'
import { getResource } from '@anticrm/platform'
import { showPopup } from '@anticrm/ui'
import type { Integration, IntegrationType } from '@anticrm/setting'
import setting from '@anticrm/setting'
import { getClient } from '@anticrm/presentation'
import type { Ref, Space } from '@anticrm/core'
import login from '@anticrm/login'
import { getCurrentAccount, Ref, Space } from '@anticrm/core'
export let integrationType: IntegrationType
export let integration: Integration | undefined
const accountId = getMetadata(login.metadata.LoginEmail)
const accountId = getCurrentAccount()._id
const client = getClient()
const onDisconnectP = getResource(integrationType.onDisconnect)
async function close(res: any): Promise<void> {
if (res.value) {
await client.createDoc(setting.class.Integration, accountId as Ref<Space>, {
if (res?.value) {
await client.createDoc(setting.class.Integration, accountId as string as Ref<Space>, {
type: integrationType._id,
value: res.value
})