summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issue_show/stores/index.js
blob: 8e89a2b7730a60399ab7f54b58a83dc52339b257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
export default class Store {
  constructor({
    titleHtml,
    descriptionHtml,
    descriptionText,
  }) {
    this.state = {
      titleHtml,
      titleText: '',
      descriptionHtml,
      descriptionText,
      taskStatus: '',
      updatedAt: '',
    };
  }

  updateState(data) {
    this.state.titleHtml = data.title;
    this.state.titleText = data.title_text;
    this.state.descriptionHtml = data.description;
    this.state.descriptionText = data.description_text;
    this.state.taskStatus = data.task_status;
    this.state.updatedAt = data.updated_at;
  }
}