Skip to content
Snippets Groups Projects
Commit f2315407 authored by Maximilian Giller's avatar Maximilian Giller
Browse files

Only using string ids, discarded number parsing

parent 00ac7f7b
No related branches found
No related tags found
1 merge request!2Implemented editor in the react framework
Pipeline #56558 failed
...@@ -96,15 +96,8 @@ export class Link extends GraphElement { ...@@ -96,15 +96,8 @@ export class Link extends GraphElement {
public static parse(raw: any): Link { public static parse(raw: any): Link {
const link: Link = new Link(); const link: Link = new Link();
link.sourceId = Number(raw.source); link.sourceId = raw.source;
link.targetId = Number(raw.target); link.targetId = raw.target;
// Ids successfully parsed as numbers?
if (isNaN(link.sourceId) || isNaN(link.targetId)) {
// No, fallback to string ids
link.sourceId = raw.source;
link.targetId = raw.target;
}
return link; return link;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment