mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-13 13:17:45 +02:00
UBERF-4725 Migrate collaborative content (#5717)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
+31
-12
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user