biz9-logic 4.8.194 → 4.8.197

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='6.7.4'
1
+ VERSION='6.7.7'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -1050,6 +1050,17 @@ class Favorite_Logic {
1050
1050
  });
1051
1051
  return favorite;
1052
1052
  }
1053
+ static get_favorite_by_list = (favorite_list,item_list) =>{
1054
+ for(let a = 0; a<item_list.length; a++){
1055
+ item_list[a].is_favorite = false;
1056
+ for(let b = 0; b<favorite_list.length; b++){
1057
+ if(item_list[a].id == favorite_list[b].parent_id){
1058
+ item_list[a].is_favorite = true;
1059
+ }
1060
+ }
1061
+ }
1062
+ return item_list;
1063
+ }
1053
1064
  static get_user_search_filter = (parent_data_type,user_id) =>{
1054
1065
  return {
1055
1066
  $and: [
@@ -1283,8 +1294,8 @@ class FAQ_Url {
1283
1294
  };
1284
1295
  }
1285
1296
  class Cart_Url {
1286
- static update = (app_id,url,parent_data_type,user_id,params) => {
1287
- let action_url="cart/update/"+parent_data_type+"/"+user_id;
1297
+ static post = (app_id,url,parent_data_type,user_id,params) => {
1298
+ let action_url="cart/post/"+parent_data_type+"/"+user_id;
1288
1299
  return get_cloud_url_main(app_id,url,action_url,params);
1289
1300
  };
1290
1301
  static get = (app_id,url,cart_number,params) => {
@@ -1297,8 +1308,8 @@ class Cart_Url {
1297
1308
  };
1298
1309
  }
1299
1310
  class Order_Url {
1300
- static update = (app_id,url,params) => {
1301
- let action_url="order/update";
1311
+ static post = (app_id,url,params) => {
1312
+ let action_url="order/post";
1302
1313
  return get_cloud_url_main(app_id,url,action_url,params);
1303
1314
  };
1304
1315
  static get = (app_id,url,order_number,params) => {
@@ -1333,8 +1344,8 @@ class Review_Url {
1333
1344
  let action_url="review/get/"+parent_data_type+"/"+user_id+"/"+page_current+"/"+page_size;
1334
1345
  return get_cloud_url_main(app_id,url,action_url,params);
1335
1346
  };
1336
- static update = (app_id,url,parent_data_type,parent_id,user_id,params) => {
1337
- let action_url="review/update/"+parent_data_type+"/"+parent_id+"/"+user_id;
1347
+ static post = (app_id,url,parent_data_type,parent_id,user_id,params) => {
1348
+ let action_url="review/post/"+parent_data_type+"/"+parent_id+"/"+user_id;
1338
1349
  return get_cloud_url_main(app_id,url,action_url,params);
1339
1350
  };
1340
1351
  }
@@ -1433,14 +1444,14 @@ class Favorite_Url {
1433
1444
  let action_url="favorite/get/"+parent_data_type+"/"+user_id+"/"+page_current+"/"+page_size;
1434
1445
  return get_cloud_url_main(app_id,url,action_url,params);
1435
1446
  };
1436
- static update = (app_id,url,parent_data_type,parent_id,user_id,params) => {
1437
- let action_url="favorite/update/"+parent_data_type+"/"+parent_id +"/"+user_id;
1447
+ static post = (app_id,url,parent_data_type,parent_id,user_id,params) => {
1448
+ let action_url="favorite/post/"+parent_data_type+"/"+parent_id +"/"+user_id;
1438
1449
  return get_cloud_url_main(app_id,url,action_url,params);
1439
1450
  };
1440
1451
  }
1441
1452
  class Item_Url {
1442
- static update_cms_item = (app_id,url,data_type,id,params) => {
1443
- let action_url = "item/update_cms_item/"+data_type+"/"+id;
1453
+ static post_cms_item = (app_id,url,data_type,id,params) => {
1454
+ let action_url = "item/post_cms_item/"+data_type+"/"+id;
1444
1455
  return get_cloud_url_main(app_id,url,action_url,params);
1445
1456
  };
1446
1457
  }
@@ -1507,15 +1518,15 @@ class Url{
1507
1518
  return get_cloud_url_main(app_id,url,action_url,params);
1508
1519
  };
1509
1520
  static upload_file = (app_id,url,data_type,id,params) => {
1510
- let action_url = "main/crud/update/"+data_type + "/" + id;
1521
+ let action_url = "main/crud/post/"+data_type + "/" + id;
1511
1522
  return get_cloud_url_main(app_id,url,action_url,params);
1512
1523
  };
1513
- static update = (app_id,url,data_type,id,params) => {
1514
- let action_url = "main/crud/update/"+data_type + "/" + id;
1524
+ static post = (app_id,url,data_type,id,params) => {
1525
+ let action_url = "main/crud/post/"+data_type + "/" + id;
1515
1526
  return get_cloud_url_main(app_id,url,action_url,params);
1516
1527
  };
1517
- static update_list = (app_id,url,data_type,params) => {
1518
- let action_url = "main/crud/update_list/"+data_type;
1528
+ static post_list = (app_id,url,data_type,params) => {
1529
+ let action_url = "main/crud/post_list/"+data_type;
1519
1530
  return get_cloud_url_main(app_id,url,action_url,params);
1520
1531
  };
1521
1532
  }
@@ -1880,7 +1891,7 @@ class User_Logic {
1880
1891
  return country_state_city;
1881
1892
  }
1882
1893
  static get_guest(){
1883
- return DataItem.get_new(DataType.USER,Num.get_id(999),{is_guest:true,title:"Guest",country:"United States"});
1894
+ return DataItem.get_new(DataType.USER,0,{is_guest:true,title_url:'guest',first_name:'Guest',last_name:'User',email:'guest@email.com',title:"Guest",country:"United States"});
1884
1895
  }
1885
1896
  static get_request_user(req){
1886
1897
  if(!req || !req.session.user){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.8.194",
3
+ "version": "4.8.197",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -31,9 +31,13 @@ describe("connect", () => {
31
31
  series([
32
32
 
33
33
  function(call) {
34
- console.log('PRODUCT-URL-START');
35
- console.log(Product_Url.search('cool','google.com'));
36
- console.log('PRODUCT-URL-END');
34
+ console.log('USER-START');
35
+ console.log(User_Logic.get_guest());
36
+ console.log('USER-END');
37
+
38
+ //console.log('PRODUCT-URL-START');
39
+ //console.log(Product_Url.search('cool','google.com'));
40
+ //console.log('PRODUCT-URL-END');
37
41
  //let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
38
42
  //let action_url = 'test_get_url';
39
43
  //let params = '&myparam1=p1&myparam2=p2'