mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-19 23:00:13 +00:00
fix create application
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
d034094829
commit
e9f12766c1
@ -38,11 +38,14 @@
|
|||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
async function createCandidate() {
|
async function createApplication() {
|
||||||
const state = client.findOne(core.class.State, { space })
|
const state = await client.findOne(core.class.State, { space })
|
||||||
|
if (state === undefined) {
|
||||||
|
throw new Error('create application: state not found')
|
||||||
|
}
|
||||||
await client.createDoc(recruit.class.Applicant, space, {
|
await client.createDoc(recruit.class.Applicant, space, {
|
||||||
candidate,
|
candidate,
|
||||||
state
|
state: state._id
|
||||||
})
|
})
|
||||||
dispatch('close')
|
dispatch('close')
|
||||||
}
|
}
|
||||||
@ -51,7 +54,7 @@
|
|||||||
|
|
||||||
<Card label={'Create Application'}
|
<Card label={'Create Application'}
|
||||||
okLabel={'Save'}
|
okLabel={'Save'}
|
||||||
okAction={createCandidate}
|
okAction={createApplication}
|
||||||
on:close={() => { dispatch('close') }}>
|
on:close={() => { dispatch('close') }}>
|
||||||
<Grid column={1} rowGap={1.75}>
|
<Grid column={1} rowGap={1.75}>
|
||||||
<UserBox _class={recruit.class.Candidate} title='Candidate' caption='Candidates' bind:value={candidate} />
|
<UserBox _class={recruit.class.Candidate} title='Candidate' caption='Candidates' bind:value={candidate} />
|
||||||
|
Loading…
Reference in New Issue
Block a user