Commit e8cc3d35 authored by Romain DELEAU's avatar Romain DELEAU

fix: error when upload a file which a supplementaryRole is affected to a task

parent 750541f9
...@@ -195,9 +195,9 @@ export class AppComponent { ...@@ -195,9 +195,9 @@ export class AppComponent {
task.characters[i] = scenario.characters[index]; task.characters[i] = scenario.characters[index];
} }
}); });
task.supplementaryRole = Object.assign(new SupplementaryRole, task.supplementaryRole);
let supplementaryRoleIndex: number | undefined = role.supplementaryRoles.findIndex(element => let supplementaryRoleIndex: number | undefined = role.supplementaryRoles.findIndex(element =>
element.name == task.supplementaryRole.name element.name == task.supplementaryRole.name && element.color == task.supplementaryRole.color
&& element.color == task.supplementaryRole.color
); );
task.supplementaryRole = role.supplementaryRoles[supplementaryRoleIndex]; task.supplementaryRole = role.supplementaryRoles[supplementaryRoleIndex];
task.prerequireRessources = task.prerequireRessources.map((prerequireData: any) => Object.assign(new PrerequireRessource(), prerequireData)); task.prerequireRessources = task.prerequireRessources.map((prerequireData: any) => Object.assign(new PrerequireRessource(), prerequireData));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment