set data on api
This commit is contained in:
@@ -2,6 +2,7 @@ import { UmbMemberCollectionRepository } from '../../collection/index.js';
|
||||
import type { UmbMemberDetailModel } from '../../types.js';
|
||||
import type { UmbMemberItemModel } from '../../repository/index.js';
|
||||
import type { UmbMemberPickerModalValue, UmbMemberPickerModalData } from './member-picker-modal.token.js';
|
||||
import type { PropertyValueMap } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { customElement, html, repeat, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbSelectionManager } from '@umbraco-cms/backoffice/utils';
|
||||
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
|
||||
@@ -41,6 +42,13 @@ export class UmbMemberPickerModalElement extends UmbModalBaseElement<
|
||||
);
|
||||
}
|
||||
|
||||
protected override async updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>) {
|
||||
super.updated(_changedProperties);
|
||||
if (_changedProperties.has('data') && this.data) {
|
||||
this.#api.setData(this.data);
|
||||
}
|
||||
}
|
||||
|
||||
override async firstUpdated() {
|
||||
const { data } = await this.#collectionRepository.requestCollection({});
|
||||
this._members = data?.items ?? [];
|
||||
|
||||
Reference in New Issue
Block a user