UBERF-4405: empty Vacancies' members (#4105)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-11-29 21:44:10 +05:00 committed by GitHub
parent ca8bc92cbb
commit 89baa98767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

View File

@ -77,6 +77,16 @@ export const recruitOperation: MigrateOperation = {
}
}
}
},
{
state: 'remove-members',
func: async (client): Promise<void> => {
const ops = new TxOperations(client, core.account.System)
const docs = await ops.findAll(recruit.class.Vacancy, { members: { $exists: true, $ne: [] } })
for (const d of docs) {
await ops.update(d, { members: [] })
}
}
}
])
}

View File

@ -16,15 +16,7 @@
import { AttachmentStyledBox } from '@hcengineering/attachment-resources'
import contact, { Organization } from '@hcengineering/contact'
import { UserBox } from '@hcengineering/contact-resources'
import core, {
Data,
fillDefaults,
FindResult,
generateId,
getCurrentAccount,
Ref,
SortingOrder
} from '@hcengineering/core'
import core, { Data, fillDefaults, FindResult, generateId, Ref, SortingOrder } from '@hcengineering/core'
import { Card, createQuery, getClient, InlineAttributeBar, MessageBox } from '@hcengineering/presentation'
import { Vacancy as VacancyClass } from '@hcengineering/recruit'
import tags from '@hcengineering/tags'
@ -176,7 +168,7 @@
archived: false,
number: (incResult as any).object.sequence,
company,
members: [getCurrentAccount()._id],
members: [],
type: typeId
},
objectId