mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
54472: Send normalized collections/communities instead of FormData
This commit is contained in:
@@ -9,6 +9,8 @@ import { Observable } from 'rxjs';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { isNotEmpty } from '../../shared/empty.util';
|
||||
import { NormalizedCollection } from '../../core/cache/models/normalized-collection.model';
|
||||
import { ResourceType } from '../../core/shared/resource-type';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-create-collection',
|
||||
@@ -36,7 +38,7 @@ export class CreateCollectionPageComponent {
|
||||
|
||||
onSubmit(data: any) {
|
||||
this.parentUUID$.pipe(take(1)).subscribe((uuid: string) => {
|
||||
const collection = Object.assign(new Collection(), {
|
||||
const collection = Object.assign(new NormalizedCollection(), {
|
||||
name: data.name,
|
||||
metadata: [
|
||||
{ key: 'dc.description', value: data.introductory },
|
||||
@@ -44,7 +46,8 @@ export class CreateCollectionPageComponent {
|
||||
{ key: 'dc.rights', value: data.copyright },
|
||||
{ key: 'dc.rights.license', value: data.license }
|
||||
// TODO: metadata for news and provenance
|
||||
]
|
||||
],
|
||||
type: ResourceType.Collection
|
||||
});
|
||||
this.collectionDataService.create(collection, uuid).subscribe((rd: RemoteData<Collection>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
|
Reference in New Issue
Block a user