diff --git a/packages/person-profile/src/person-profile.js b/packages/person-profile/src/person-profile.js index 4b8ff46edfa6a7c93fd126b7db22517c94be3e32..434d3dd34cce2edb556feade04052f36cc9c7d33 100644 --- a/packages/person-profile/src/person-profile.js +++ b/packages/person-profile/src/person-profile.js @@ -49,19 +49,21 @@ class PersonProfile extends VPULitElement { }, {}, that.lang); break; case 'value': - const apiUrl = this.entryPointUrl + '/people/' + this.value; + if (this.value !== '') { + const apiUrl = this.entryPointUrl + '/people/' + this.value; - // load person - fetch(apiUrl, { - headers: { - 'Content-Type': 'application/ld+json', - 'Authorization': 'Bearer ' + window.VPUAuthToken, - }, - }) - .then(response => response.json()) - .then((person) => { - this.person = person; - }); + // load person + fetch(apiUrl, { + headers: { + 'Content-Type': 'application/ld+json', + 'Authorization': 'Bearer ' + window.VPUAuthToken, + }, + }) + .then(response => response.json()) + .then((person) => { + this.person = person; + }); + } break; default: }