remove duplicate store methods
This commit is contained in:
@@ -153,7 +153,7 @@ export class UmbDocumentTypeDetailRepository
|
||||
// Consider to look up the data before fetching from the server.
|
||||
// Consider notify a workspace if a template is deleted from the store while someone is editing it.
|
||||
// TODO: would be nice to align the stores on methods/methodNames.
|
||||
this.#detailStore?.remove([id]);
|
||||
this.#detailStore?.removeItem(id);
|
||||
this.#treeStore?.removeItem(id);
|
||||
this.#itemStore?.removeItem(id);
|
||||
}
|
||||
|
||||
@@ -25,31 +25,13 @@ export class UmbDocumentTypeDetailStore extends UmbStoreBase<DocumentTypeRespons
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a document-type to the store
|
||||
* @param {DocumentTypeModel} document
|
||||
* @memberof UmbDocumentTypeStore
|
||||
*/
|
||||
append(document: DocumentTypeResponseModel) {
|
||||
this._data.append([document]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a document-type to the store
|
||||
* @param {DocumentTypeModel} document
|
||||
* @memberof UmbDocumentTypeStore
|
||||
* @param {DocumentTypeResponseModel['id']} id
|
||||
* @return {*}
|
||||
* @memberof UmbDocumentTypeDetailStore
|
||||
*/
|
||||
byId(id: DocumentTypeResponseModel['id']) {
|
||||
return this._data.asObservablePart((x) => x.find((y) => y.id === id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes document-types in the store with the given uniques
|
||||
* @param {string[]} uniques
|
||||
* @memberof UmbDocumentTypeStore
|
||||
*/
|
||||
remove(uniques: Array<DocumentTypeResponseModel['id']>) {
|
||||
this._data.remove(uniques);
|
||||
}
|
||||
}
|
||||
|
||||
export const UMB_DOCUMENT_TYPE_DETAIL_STORE_CONTEXT = new UmbContextToken<UmbDocumentTypeDetailStore>(
|
||||
|
||||
Reference in New Issue
Block a user