Преглед изворни кода

export interface IRelation

visuddhinanda пре 2 година
родитељ
комит
25376a2dae
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      dashboard/src/components/template/Wbw/WbwDetailRelation.tsx

+ 2 - 2
dashboard/src/components/template/Wbw/WbwDetailRelation.tsx

@@ -15,7 +15,7 @@ interface IOptions {
   label: JSX.Element;
 }
 
-interface IRelation {
+export interface IRelation {
   sour_id: string;
   sour_spell: string;
   dest_id: string;
@@ -44,7 +44,7 @@ const WbwDetailRelationWidget = ({ data, onChange, onAdd }: IWidget) => {
       const newRelation: IRelation = {
         sour_id: `${data.book}-${data.para}-` + data.sn.join("-"),
         sour_spell: data.word.value,
-        dest_id: `${addParam.book}-${addParam.para}-` + addParam.target_id,
+        dest_id: addParam.target_id ? addParam.target_id : "",
         dest_spell: addParam.target_spell,
       };
       setRelation([...relation, newRelation]);