Skip to content
Snippets Groups Projects
Commit 0254b1eb authored by Jonas Schlabertz's avatar Jonas Schlabertz
Browse files

Fixes more typos.

parent 48f3c8b9
No related branches found
No related tags found
No related merge requests found
Pipeline #161675 passed
......@@ -68,7 +68,9 @@ export default class ComponentRelation {
}
static findById(id: string, repository: Repository<ComponentRelation>): Promise<ComponentRelation | undefined> {
return repository.findOne(id);
return repository.findOne(id, {
relations: ["parent", "child"]
});
}
static findParentRelation(component: Component, repository: Repository<ComponentRelation>): Promise<ComponentRelation | undefined> {
......@@ -93,11 +95,11 @@ export default class ComponentRelation {
};
if(this.parent) {
document["parent"] = { "@id": `${config.baseURL}/relation/${this.parent.id.toString()}`};
document["parent"] = { "@id": `${config.baseURL}/component/${this.parent.id.toString()}`};
}
if(this.child) {
document["child"] = { "@id": `${config.baseURL}/relation/${this.child.id.toString()}`};
document["child"] = { "@id": `${config.baseURL}/component/${this.child.id.toString()}`};
}
if(this.to) {
......
......@@ -10,7 +10,9 @@ const componentRelation = {
"id": { "@id": "https://schema.org/url", "@type": "@id"},
"from": "https://schema.org/DateTime",
"to": "https://schema.org/DateTime",
"license": "https://www.w3.org/1999/xhtml/vocab#license"
"license": "https://www.w3.org/1999/xhtml/vocab#license",
"parent": { "@id": "https://schema.org/url", "@type": "@id"},
"child": { "@id": "https://schema.org/url", "@type": "@id"}
};
const information = function(metadataContext: unknown, previousVersion: ComponentInformation | undefined, nextVersion: ComponentInformation | undefined): Record<string, unknown> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment