@@ -1248,6 +1248,67 @@ function getGuessList(data){
1248
1248
} ) ;
1249
1249
}
1250
1250
1251
+ function getStatisfyYes ( robotAgentId , satisfactionCommentKey ) {
1252
+ return new Promise ( function ( resolve , reject ) {
1253
+ emajax ( {
1254
+ url : "/v1/webimplugin/tenants/" + config . tenantId + "/robot-agents/" + robotAgentId + "/satisfaction-comment" ,
1255
+ data : {
1256
+ satisfactionCommentKey : satisfactionCommentKey ,
1257
+ type : 1
1258
+ } ,
1259
+ type : "POST" ,
1260
+ success : function ( resp ) {
1261
+ var parsed ;
1262
+
1263
+ try {
1264
+ parsed = JSON . parse ( resp ) ;
1265
+ }
1266
+ catch ( e ) { }
1267
+
1268
+ if ( ( parsed && parsed . status ) === "OK" ) {
1269
+ resolve ( parsed . entity ) ;
1270
+ }
1271
+ else {
1272
+ reject ( parsed ) ;
1273
+ }
1274
+ } ,
1275
+ error : function ( e ) {
1276
+ reject ( e ) ;
1277
+ }
1278
+ } ) ;
1279
+ } ) ;
1280
+ }
1281
+ function getStatisfyNo ( robotAgentId , satisfactionCommentKey ) {
1282
+ return new Promise ( function ( resolve , reject ) {
1283
+ emajax ( {
1284
+ url : "/v1/webimplugin/tenants/" + config . tenantId + "/robot-agents/" + robotAgentId + "/satisfaction-comment" ,
1285
+ data : {
1286
+ satisfactionCommentKey : satisfactionCommentKey ,
1287
+ type : 2
1288
+ } ,
1289
+ type : "POST" ,
1290
+ success : function ( resp ) {
1291
+ var parsed ;
1292
+
1293
+ try {
1294
+ parsed = JSON . parse ( resp ) ;
1295
+ }
1296
+ catch ( e ) { }
1297
+
1298
+ if ( ( parsed && parsed . status ) === "OK" ) {
1299
+ resolve ( parsed . entity ) ;
1300
+ }
1301
+ else {
1302
+ reject ( parsed ) ;
1303
+ }
1304
+ } ,
1305
+ error : function ( e ) {
1306
+ reject ( e ) ;
1307
+ }
1308
+ } ) ;
1309
+ } ) ;
1310
+ }
1311
+
1251
1312
module . exports = {
1252
1313
getCurrentServiceSession : getCurrentServiceSession ,
1253
1314
getToken : getToken ,
@@ -1300,6 +1361,8 @@ module.exports = {
1300
1361
getGuessList : getGuessList ,
1301
1362
1302
1363
initApiTransfer : initApiTransfer ,
1364
+ getStatisfyYes : getStatisfyYes ,
1365
+ getStatisfyNo : getStatisfyNo ,
1303
1366
api : api ,
1304
1367
setCacheItem : function ( key , value ) {
1305
1368
cache [ key ] = value ;
0 commit comments