4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 var rw
= require('utils/rw.js');
20 var API_SERVER
= rw
.getSearchParams(window
.location
).api_server
;
21 var crashActions
= require('./crashActions.js');
22 var Utils
= require('utils/utils.js');
23 import $ from 'jquery';
28 remote: function(state
) {
29 return new Promise(function(resolve
, reject
) {
31 url
: 'api/crash-details?api_server=' + API_SERVER
,
33 beforeSend
: Utils
.addAuthorizationStub
,
34 contentType
: "application/json",
35 success: function(data
) {
38 error: function(error
) {
39 console
.log("There was an error getting the crash details: ", error
);
42 }).fail(function(xhr
){
44 //Authentication and the handling of fail states should be wrapped up into a connection class.
45 Utils
.checkAuthentication(xhr
.status
);
47 }).catch(function(err
){console
.log(err
)});
49 success
: crashActions
.getCrashDetailsSuccess
,
50 loading
: crashActions
.getCrashDetailsLoading
,
51 error
: crashActions
.getCrashDetailsFail
55 module
.exports
= crashSource
;