Rework Attachments as a bag (#193)

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov
2021-09-15 19:03:34 +02:00
committed by GitHub
parent 74d46558f1
commit bf9f479500
27 changed files with 923 additions and 833 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ import cors from 'cors'
import { v4 as uuid } from 'uuid'
import { decode } from 'jwt-simple'
import type { Space, Ref, Doc, Account } from '@anticrm/core'
import { Space, Ref, Doc, Account, generateId } from '@anticrm/core'
// import { TxFactory } from '@anticrm/core'
import type { Token, IndexedDoc } from '@anticrm/server-core'
import { createElasticAdapter } from '@anticrm/elastic'
@@ -131,7 +131,7 @@ export function start (transactorEndpoint: string, elasticUrl: string, minio: Cl
const uuid = await minioUpload(minio, payload.workspace, file)
console.log('uploaded uuid', uuid)
const id = req.query.id as Ref<Doc>
const name = req.query.name as string
const space = req.query.space as Ref<Space>
const attachedTo = req.query.attachedTo as Ref<Doc>
// const name = req.query.name as string
@@ -150,7 +150,7 @@ export function start (transactorEndpoint: string, elasticUrl: string, minio: Cl
const elastic = await createElasticAdapter(elasticUrl, payload.workspace)
const indexedDoc: IndexedDoc = {
id,
id: generateId() + '/attachments/' + name,
_class: chunter.class.Attachment,
space,
modifiedOn: Date.now(),