1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-28 16:17:02 +00:00
Files
seahub/frontend/src/models/review-comment.js
Michael18811380328 3e36e7c2ff a
2018-12-11 15:52:30 +08:00

24 lines
612 B
JavaScript

import moment from 'moment';
class reviewComment {
constructor(item) {
let oldTime = (new Date(item.created_at)).getTime();
this.time = moment(oldTime).format('YYYY-MM-DD HH:mm');
this.id = item.id;
this.avatarUrl = item.avatar_url;
this.comment = item.comment;
this.name = item.user_name;
this.userEmail = item.user_email;
this.resolved = item.resolved;
if (item.detail) {
let detail = JSON.parse(item.detail);
this.newIndex = detail.newIndex;
this.oldIndex = detail.oldIndex;
this.quote = detail.quote;
}
}
}
export default reviewComment;