rollback debug change

This commit is contained in:
Art Lowel
2020-02-26 14:17:27 +01:00
parent 5b326aea92
commit b4a63fccf4

View File

@@ -55,20 +55,16 @@ export class LinkService {
parent: this.parentInjector parent: this.parentInjector
}).get(provider); }).get(provider);
const link = model._links[matchingLinkDef.linkName]; const href = model._links[matchingLinkDef.linkName].href;
if (hasValue(link)) { try {
const href = link.href; if (matchingLinkDef.isList) {
model[linkToFollow.name] = service.findAllByHref(href, linkToFollow.findListOptions, ...linkToFollow.linksToFollow);
try { } else {
if (matchingLinkDef.isList) { model[linkToFollow.name] = service.findByHref(href, ...linkToFollow.linksToFollow);
model[linkToFollow.name] = service.findAllByHref(href, linkToFollow.findListOptions, ...linkToFollow.linksToFollow);
} else {
model[linkToFollow.name] = service.findByHref(href, ...linkToFollow.linksToFollow);
}
} catch (e) {
throw new Error(`Something went wrong when using @dataService(${matchingLinkDef.resourceType.value}) ${hasValue(service) ? '' : '(undefined) '}to resolve link ${linkToFollow.name} from ${href}`);
} }
} catch (e) {
throw new Error(`Something went wrong when using @dataService(${matchingLinkDef.resourceType.value}) ${hasValue(service) ? '' : '(undefined) '}to resolve link ${linkToFollow.name} from ${href}`);
} }
} }
return model; return model;