diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index d9e42988a6..db7831f01e 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -27,6 +27,7 @@ import SpaceSelect from './SpaceSelect.svelte' export let spaceClass: Ref> + export let space: Ref export let label: IntlString export let okLabel: IntlString export let okAction: () => void @@ -44,7 +45,7 @@
- +
diff --git a/plugins/recruit-resources/src/components/CreateApplication.svelte b/plugins/recruit-resources/src/components/CreateApplication.svelte index d4bd2ef1ac..5804ad4f1f 100644 --- a/plugins/recruit-resources/src/components/CreateApplication.svelte +++ b/plugins/recruit-resources/src/components/CreateApplication.svelte @@ -34,15 +34,17 @@ export let preserveCandidate = false + let _space = space + const dispatch = createEventDispatcher() const client = getClient() async function createApplication() { - const state = await client.findOne(core.class.State, { space }) + const state = await client.findOne(core.class.State, { space: _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, state: state._id }) @@ -56,6 +58,7 @@ okAction={createApplication} canSave={candidate !== undefined} spaceClass={recruit.class.Vacancy} + bind:space={_space} on:close={() => { dispatch('close') }}> {#if !preserveCandidate}