summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/merge_conflicts/merge_conflict_service.js.es6
blob: 8a7519b07869e540e1989568c6383b9a63b6aa36 (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
26
27
28
29
30
31
/* eslint-disable */
((global) => {
  global.mergeConflicts = global.mergeConflicts || {};

  class mergeConflictsService {
    constructor(options) {
      this.conflictsPath = options.conflictsPath;
      this.resolveConflictsPath = options.resolveConflictsPath;
    }

    fetchConflictsData() {
      return $.ajax({
        dataType: 'json',
        url: this.conflictsPath
      });
    }

    submitResolveConflicts(data) {
      return $.ajax({
        url: this.resolveConflictsPath,
        data: JSON.stringify(data),
        contentType: 'application/json',
        dataType: 'json',
        method: 'POST'
      });
    }
  };

  global.mergeConflicts.mergeConflictsService = mergeConflictsService;

})(window.gl || (window.gl = {}));