[ACS-4117] Added possibility to create multiple categories (#8382)

* [ACS-4117] added possibility to create multiple subcategories

* [ACS-4117] renamed api function to follow updated code

* [ACS-4117] js-api update

* [ACS-4117] package-lock

* [ACS-4117] rebase

* [ACS-4117] empty commit
This commit is contained in:
Nikita Maliarchuk
2023-03-24 10:38:06 +01:00
committed by GitHub
parent 7c988fe4d3
commit 0089f188a4
13 changed files with 35 additions and 24 deletions

View File

@@ -22,7 +22,7 @@
"@angular/platform-browser": ">=14.1.3",
"@angular/platform-browser-dynamic": ">=14.1.3",
"@angular/router": ">=14.1.3",
"@alfresco/js-api": "5.5.0-741",
"@alfresco/js-api": "5.5.0-754",
"@ngx-translate/core": ">=14.0.0",
"moment": ">=2.22.2",
"@alfresco/adf-core": "6.0.0-A.3"

View File

@@ -62,8 +62,8 @@ describe('CategoryService', () => {
}));
it('should create subcategory', fakeAsync(() => {
const createSpy = spyOn(categoryService.categoriesApi, 'createSubcategory').and.returnValue(Promise.resolve(fakeCategoryEntry));
categoryService.createSubcategory(fakeParentCategoryId, fakeCategoryEntry.entry).subscribe(() => {
const createSpy = spyOn(categoryService.categoriesApi, 'createSubcategories').and.returnValue(Promise.resolve(fakeCategoryEntry));
categoryService.createSubcategories(fakeParentCategoryId, [fakeCategoryEntry.entry]).subscribe(() => {
expect(createSpy).toHaveBeenCalledOnceWith(fakeParentCategoryId, [fakeCategoryEntry.entry], {});
});
}));

View File

@@ -58,14 +58,14 @@ export class CategoryService {
}
/**
* Creates subcategory under category with provided categoryId
* Creates subcategories under category with provided categoryId
*
* @param parentCategoryId The identifier of a parent category.
* @param payload Created category body
* @return Observable<CategoryEntry>
* @param payload List of categories to be created.
* @return Observable<CategoryPaging | CategoryEntry>
*/
createSubcategory(parentCategoryId: string, payload: CategoryBody): Observable<CategoryEntry> {
return from(this.categoriesApi.createSubcategory(parentCategoryId, [payload], {}));
createSubcategories(parentCategoryId: string, payload: CategoryBody[]): Observable<CategoryPaging | CategoryEntry> {
return from(this.categoriesApi.createSubcategories(parentCategoryId, payload, {}));
}
/**