Skip to content

Commit

Permalink
Fixing bug in addition of author class and id in segments
Browse files Browse the repository at this point in the history
  • Loading branch information
sajeeth1009 committed Nov 10, 2019
1 parent fc77409 commit a443aaf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions srv/src/labels/labels.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion web/src/app/editor/timeline/timeline.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/labels/labels.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit a443aaf

Please sign in to comment.