client/src/api/WebAnnotationSerializer.js
changeset 129 d48946d164c6
parent 102 b0e36664f1f2
child 168 ea92f4fe783d
equal deleted inserted replaced
128:34a75bd8d0b9 129:d48946d164c6
     1 class WebAnnotationSerializer {
     1 class WebAnnotationSerializer {
     2 
     2 
     3   static serialize = (note) => {
     3   static serialize = (note) => {
     4 
     4 
     5     const categories = note.categories;
     5     const categories = note.get('categories');
     6 
     6 
     7     const baseAnnotation = {
     7     const baseAnnotation = {
     8       '@context': "http://www.w3.org/ns/anno.jsonld",
     8       '@context': "http://www.w3.org/ns/anno.jsonld",
     9       "type":     "Annotation",
     9       "type":     "Annotation",
    10     }
    10     }
    11 
    11 
    12     const source = "/session/" + note.session + "/notes/" + note._id;
    12     const source = "/session/" + note.get('session') + "/notes/" + note.get('_id');
    13 
    13 
    14     return categories.map((category, index) => {
    14     return categories.map((category, index) => {
    15 
    15 
    16       let annotation = Object.assign({}, baseAnnotation, {
    16       let annotation = Object.assign({}, baseAnnotation, {
    17         id: index
    17         id: index