fixed undefined organizations and apiParams

This commit is contained in:
andreas.mantas 2022-07-29 11:54:23 +00:00
parent ba5c23f1ab
commit 00079f9dde
2 changed files with 13 additions and 8 deletions

View File

@ -105,15 +105,15 @@ export class DatasourceDetails {
aggregator: string;
collectedfrom: string;
managed: boolean;
consentTermsOfUse: boolean;
fullTextDownload: boolean;
registrationdate: Date;
consentTermsOfUseDate: Date;
lastConsentTermsOfUseDate: Date;
organizations: OrganizationDetails[];
consentTermsOfUse: boolean;
fullTextDownload: boolean;
organizations: OrganizationDetails[] = new Array<OrganizationDetails>();
identities: IdentitiesDetails[];
status: string;
typology: string;
registrationdate: Date;
}
export class Repository extends DatasourceDetails implements IsSerializable {
@ -226,7 +226,7 @@ export class ApiDetails {
lastDownloadDate: Date;
baseurl: string;
removable: boolean;
apiParams: ApiParamDetails[];
apiParams: ApiParamDetails[] = new Array<ApiParamDetails>();
metadataIdentifierPath: string;
typology: string;
comments: string;

View File

@ -227,14 +227,19 @@ export class DatasourceCreateFormComponent implements OnInit {
}
createNewRepository(): Repository {
const newRepo: Repository = new Repository();
const newRepo = new Repository();
newRepo.officialName = this.group.get('officialName').value.toString();
newRepo.englishName = this.group.get('englishName').value.toString();
newRepo.websiteUrl = this.group.get('websiteUrl').value;
newRepo.logoUrl = this.group.get('logoUrl').value;
newRepo.contactEmail = this.group.get('adminEmail').value;
newRepo.organizations[0].country = this.group.get('country').value; // countryCode
newRepo.organizations[0].legalname = this.group.get('institutionName').value.toString();
newRepo.organizations.push({
legalshortname: null,
legalname: this.group.get('institutionName').value.toString(),
websiteurl: null,
logourl: null,
country: this.group.get('country').value
});
newRepo.latitude = this.group.get('latitude').value;
newRepo.longitude = this.group.get('longtitude').value;
newRepo.timezone = this.group.get('timezone').value;