diff --git a/srv/src/labels/labels.gateway.ts b/srv/src/labels/labels.gateway.ts index d950e64..51a7672 100644 --- a/srv/src/labels/labels.gateway.ts +++ b/srv/src/labels/labels.gateway.ts @@ -153,10 +153,10 @@ export class LabelsGateway { async addSegment(socket: SocketIO.Socket, data) { const room = LabelsGateway.getProjectRoom(socket); const labelId = data.group; - const authorId = ''; + const authorId = data.authorId; const start = data.start; const end = data.end; - const authorClass = data.authorClass; + const authorClass = data.authorRole; const hyperid = data.hyperid; return await this.segmentService .createSegment(labelId, authorId, start, end, authorClass) diff --git a/web/src/app/editor/timeline/timeline.component.ts b/web/src/app/editor/timeline/timeline.component.ts index 8a120f3..0d9fe3c 100644 --- a/web/src/app/editor/timeline/timeline.component.ts +++ b/web/src/app/editor/timeline/timeline.component.ts @@ -267,7 +267,8 @@ export class TimelineComponent implements OnInit, AfterViewInit, OnDestroy { group: item.group, start: item.start, end: item.end, - userRole: this.userRole + authorRole: this.userRole, + authorId: JSON.parse(localStorage.getItem('currentSession$'))['user']['id'] }; this.labelsService.addSegment(segment).then(() => { console.log('segment added'); diff --git a/web/src/app/labels/labels.service.ts b/web/src/app/labels/labels.service.ts index f7f62f6..a2e5523 100644 --- a/web/src/app/labels/labels.service.ts +++ b/web/src/app/labels/labels.service.ts @@ -196,7 +196,7 @@ export class LabelsService { return this.socket.fromEvent('getSegments'); } - addSegment(p: { hyperid: IdType; group: string; start: DateType; end: DateType, userRole: string }) { + addSegment(p: { hyperid: IdType; group: string; start: DateType; end: DateType, authorRole: string, authorId: string }) { console.log(p); return new Promise(((resolve, reject) => { this.socket.emit('addSegment', p, (err) => {