Skip to content

Commit 99128b7

Browse files
committed
feat: Provide identityForm context in identityForm component
1 parent d57dd25 commit 99128b7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/components/identityForm/index.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ const identity = ref<Identity>(props.identity)
7474
const tabs = ref(props.identity?.additionalFields?.objectClasses ?? [])
7575
const validations = ref<Record<string, unknown> | null>(props.identity?.additionalFields?.validations ?? {})
7676
77+
provide('identityForm', identity)
78+
7779
watch(() => props.identity, () => {
7880
identity.value = props.identity
7981
tabs.value = props.identity?.additionalFields?.objectClasses ?? []

src/components/jsonFormRendererApi.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import { QuasarJsonformRenderer } from './quasar-jsonform';
2525
import { computed, provide, ref } from 'vue';
2626
import { useFetch } from 'nuxt/app';
2727
import type { ErrorObject } from 'ajv';
28+
import type { components, operations } from '#build/types/service-api'
29+
type Identity = components['schemas']['IdentitiesDto'] & { _id: string }
2830
2931
const customStyle = mergeStyles(defaultStyles, {
3032
control: {
@@ -95,11 +97,20 @@ const { data: result, pending, error, refresh } = await useHttp<any>(`/managemen
9597
method: 'GET',
9698
});
9799
100+
const identityForm = inject('identityForm') as Ref<any>;
101+
const identityFormDebounced = refDebounced(identityForm, 10000, {
102+
rejectOnCancel: true,
103+
});
104+
98105
const { data: resultUi, pending: pendingUi, error: errorUi, refresh: refreshUi } = await useHttp<any>(`/management/identities/jsonforms/${props.schemaName}`, {
99-
method: 'GET',
106+
method: 'POST',
100107
params: {
101108
mode,
102109
},
110+
query: {
111+
mode,
112+
},
113+
body: identityFormDebounced,
103114
});
104115
105116
// const schema = ref({ ...result.value.data });

0 commit comments

Comments
 (0)