зеркало из https://github.com/microsoft/paris.git
Fix type issue in allItems (#12)
This commit is contained in:
Родитель
f37475be25
Коммит
41d52d2656
|
@ -399,7 +399,7 @@ export class Paris<TConfigData = any> {
|
|||
* @param {DataEntityType<TEntity extends EntityModelBase>} entityConstructor
|
||||
* @returns {Observable<Array<TEntity extends EntityModelBase>>}
|
||||
*/
|
||||
allItems<TEntity extends EntityModelBase>(entityConstructor:DataEntityType<TEntity>):Observable<Array<TEntity>>{
|
||||
allItems<TEntity extends EntityModelBase<TId>, TId extends EntityId>(entityConstructor:DataEntityType<TEntity, any, TId>):Observable<Array<TEntity>>{
|
||||
const repository:Repository<TEntity> = this.getRepository(entityConstructor);
|
||||
if (repository)
|
||||
return repository.allItems$;
|
||||
|
|
|
@ -299,7 +299,7 @@ describe('Modeler', () => {
|
|||
});
|
||||
|
||||
it("calls the entity's `serializeItem` method with the proper params", () => {
|
||||
const newSerializedItem = new serializedEntity({ id: undefined, name: 'test' });
|
||||
const newSerializedItem = new serializedEntity({ id: undefined, name: 'test', someArray: null });
|
||||
const serializationData = { test: 1 };
|
||||
|
||||
serializedItemRepo.save(newSerializedItem, null, serializationData);
|
||||
|
|
Загрузка…
Ссылка в новой задаче