UBERF-4725 Migrate collaborative content (#5717)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2024-08-22 16:03:42 +05:00
committed by GitHub
parent 0e72b85978
commit df2a9b2708
97 changed files with 702 additions and 820 deletions
+31 -12
View File
@@ -1,5 +1,16 @@
import { Organization } from '@hcengineering/contact'
import core, { Account, Client, Data, Doc, Ref, SortingOrder, Status, TxOperations } from '@hcengineering/core'
import core, {
Account,
Client,
Data,
Doc,
Ref,
SortingOrder,
Status,
TxOperations,
generateId,
makeCollaborativeDoc
} from '@hcengineering/core'
import recruit, { Applicant, Vacancy } from '@hcengineering/recruit'
import task, { ProjectType, makeRank } from '@hcengineering/task'
@@ -23,17 +34,25 @@ export async function createVacancy (
const incResult = await client.update(sequence, { $inc: { sequence: 1 } }, true)
const id = await client.createDoc(recruit.class.Vacancy, core.space.Space, {
name,
description: type.shortDescription ?? '',
fullDescription: type.description,
private: false,
archived: false,
company,
number: (incResult as any).object.sequence,
members: [],
type: typeId
})
const id: Ref<Vacancy> = generateId()
await client.createDoc(
recruit.class.Vacancy,
core.space.Space,
{
name,
description: type.shortDescription ?? '',
fullDescription: makeCollaborativeDoc(id, 'fullDescription'),
private: false,
archived: false,
company,
number: (incResult as any).object.sequence,
members: [],
type: typeId
},
id
)
// TODO type.description
return id
}