Changeset 2998dc4 for reactapp/src/Pages


Ignore:
Timestamp:
07/30/22 15:39:04 (2 years ago)
Author:
unknown <mlviktor23@…>
Branches:
main
Children:
e958037
Parents:
3a44163
Message:

made OpinionTree display author info

File:
1 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/Pages/Professor.js

    r3a44163 r2998dc4  
    11import React, { useEffect, useState } from "react";
    22import { Outlet, useParams } from "react-router-dom";
     3import JSOG from "jsog";
    34import OpinionTree from "../Components/OpinionTree";
    45
     
    1516      try {
    1617        const response = await fetch(url);
    17         const json = await response.json();
    18         setProfessor(json);
     18        var cyclicGraph = await response.json();
     19        var jsogStructure = JSOG.encode(cyclicGraph); // has { '@ref': 'ID' } links instead of cycles
     20        cyclicGraph = JSOG.decode(jsogStructure);
     21        setProfessor(cyclicGraph);
    1922        setLoaded(true);
    2023      } catch (error) {
Note: See TracChangeset for help on using the changeset viewer.