This commit is contained in:
GotPPay
2018-01-12 01:56:17 +01:00
parent 4c8c1c5e0e
commit b80843cb97
20 changed files with 482 additions and 453 deletions

View File

@@ -10,7 +10,8 @@ import {getSkill, updateSkill} from './lib/api'
import {
NEW_INTENT_SELECTED_INDEX,
LAUNCH_REQUEST_SELECTED_INDEX,
CONTACT_SELECTED_INDEX} from './config'
CONTACT_SELECTED_INDEX,
RESULT_CODES} from './config/constants'
class App extends Component {
@@ -180,8 +181,8 @@ class App extends Component {
return new Promise((resolve,reject)=>{
updateSkill(this.createSkill(newAllIntents,newName,newAnswer,email,updateOnAmazon)).then(l=>l.text()).then(result=>{
let jResult = JSON.parse(result);
if (jResult.result !== 0){
console.log(jResult.result);
if (jResult.result !== RESULT_CODES.OK){
console.log(jResult.result);
if (showPopUp) Popup.alert('Model was not saved. Please try again');
this.setState(rejectState);
//reject('Error code : ' + jResult.result);
@@ -191,7 +192,7 @@ class App extends Component {
resolve();
}
}).catch(e=>{
console.log('error : ' + e);
console.log('error : ' + e);
if (showPopUp) Popup.alert('Model was not saved. Please try again');
this.setState(rejectState);
//reject(e);