fix(web): type the customer group parent picker
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -174,7 +174,8 @@ const linkedGroups = computed(() =>
|
|||||||
(customerGroups.value as CustomerGroupDto[]).filter((g) => g.parentId && g.parentName),
|
(customerGroups.value as CustomerGroupDto[]).filter((g) => g.parentId && g.parentName),
|
||||||
);
|
);
|
||||||
|
|
||||||
function onChildGroup(id: string | undefined) {
|
function onChildGroup(value: unknown) {
|
||||||
|
const id = typeof value === 'string' ? value : undefined;
|
||||||
childGroupId.value = id;
|
childGroupId.value = id;
|
||||||
const current = (customerGroups.value as CustomerGroupDto[]).find((g) => g.id === id);
|
const current = (customerGroups.value as CustomerGroupDto[]).find((g) => g.id === id);
|
||||||
parentGroupId.value = current?.parentId ?? undefined;
|
parentGroupId.value = current?.parentId ?? undefined;
|
||||||
@@ -667,7 +668,7 @@ onUnmounted(() => stopPoll());
|
|||||||
placeholder="جستجوی گروه"
|
placeholder="جستجوی گروه"
|
||||||
option-filter-prop="label"
|
option-filter-prop="label"
|
||||||
:options="childGroupOptions"
|
:options="childGroupOptions"
|
||||||
@change="(value: string | undefined) => onChildGroup(value)"
|
@change="onChildGroup"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|||||||
Reference in New Issue
Block a user