biz9-logic 4.8.76 → 4.8.78

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='5.5.6'
1
+ VERSION='5.5.8'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -489,7 +489,6 @@ class Field_Logic {
489
489
  option.category_blog_post_count = req.query.category_blog_post_count ? req.query.category_blog_post_count : 9;
490
490
  option.blog_post_count = req.query.blog_post_count ? req.query.blog_post_count : 9;
491
491
 
492
-
493
492
  option.get_product = req.query.get_product ? req.query.get_product : false;
494
493
  option.get_category_product = req.query.get_category_product ? req.query.get_category_product : false;
495
494
  option.category_product_count = req.query.category_product_count ? req.query.category_product_count : 9;
@@ -505,6 +504,7 @@ class Field_Logic {
505
504
  option.category_event_count = req.query.category_event_count ? req.query.category_event_count : 9;
506
505
  option.event_count = req.query.event_count ? req.query.event_count : 9;
507
506
 
507
+ option.user_count = req.query.user_count ? req.query.user_count : 9;
508
508
  option.get_admin = req.query.get_admin ? req.query.get_admin : false;
509
509
  option.get_business = req.query.get_business ? req.query.get_business : false;
510
510
  option.get_faq = req.query.get_faq ? req.query.get_faq : false;
@@ -559,6 +559,10 @@ class Field_Logic {
559
559
  if(data_type==DataType.SUB_ITEM){
560
560
  option.item_count = option.item_count ? option.item_count : 9;
561
561
  }
562
+ if(data_type==DataType.USER){
563
+ option.user_count = option.user_count ? option.user_count : 9;
564
+ }
565
+
562
566
  return option;
563
567
  }
564
568
  static get_option_title = (title,option) =>{
@@ -1153,7 +1157,7 @@ class Url{
1153
1157
  return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
1154
1158
  };
1155
1159
  static update_delete_cache = (biz9_config,data_type,id) => {
1156
- let action_url = "main/crud/update_item_delete_cache/"+data_type + "/" + id;
1160
+ let action_url = "main/crud/update_delete_cache/"+data_type + "/" + id;
1157
1161
  return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
1158
1162
  };
1159
1163
  static update_list = (biz9_config,data_type) => {
@@ -1469,7 +1473,6 @@ class Schedule {
1469
1473
  class Storage {
1470
1474
  static get = (window,key) => {
1471
1475
  if(window){
1472
- //return JSON.parse(window.localStorage.getItem(key)) ? !Str.check_is_null(window.localStorage.getItem(key)): null;
1473
1476
  return JSON.parse(window.localStorage.getItem(key));
1474
1477
  }else{
1475
1478
  return null;
@@ -1512,6 +1515,27 @@ class User_Logic {
1512
1515
  req.session.user=null;
1513
1516
  delete req.session.user;
1514
1517
  }
1518
+ static get_test = (title,option) =>{
1519
+ [title,option] = Field_Logic.get_option_title(title,option);
1520
+ option = Field_Logic.get_option(DataType.USER,option?option:{});
1521
+ let user = DataItem.get_new_full_item(
1522
+ DataItem.get_new(DataType.USER,0),
1523
+ DataItem.get_new(DataType.USER,0),
1524
+ DataItem.get_new(DataType.USER,0),
1525
+ Field_Logic.get_test(title,option));
1526
+ user.first_name="First Name "+ Number.get_id();
1527
+ user.last_name="First Name "+ Number.get_id();
1528
+ user.email="email"+ Number.get_id() + "@email.com";
1529
+ return user;
1530
+ };
1531
+ static get_test_list = (option) =>{
1532
+ option = Field_Logic.get_option(DataType.USER,option?option:{});
1533
+ let item_list = [];
1534
+ for(let a=0;a<option.user_count+1;a++){
1535
+ item_list.push(User_Logic.get_test("User " +String(parseInt(a+1)),option));
1536
+ }
1537
+ return item_list;
1538
+ }
1515
1539
  }
1516
1540
  class Sub_Item_Logic {
1517
1541
  static get_test(title,parent_item,top_item,option){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.8.76",
3
+ "version": "4.8.78",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -84,8 +84,11 @@ describe("connect", () => {
84
84
  /* --TEAM--END */
85
85
 
86
86
  /* --USER--START */
87
- //let user = User_Logic.get_user();
87
+ //let user = User_Logic.get_test();
88
+ let user = User_Logic.get_test();
89
+ let user_list = User_Logic.get_test_list();
88
90
  //Log.w('user',user);
91
+ Log.w('user_list',user_list);
89
92
 
90
93
  /* --USER--END */
91
94
 
@@ -196,9 +199,9 @@ describe("connect", () => {
196
199
  //let product = Product_Logic.get_test({fields:["cool_beanj]})
197
200
  //Log.w("product",product);
198
201
  //let product_list = Product_Logic.get_test_list({product_count:10,get_blank:true});
199
- let product_list = Product_Logic.get_test_list({product_count:2,get_blank:false,fields:'delivery_time,apple,basnnah'})
202
+ //let product_list = Product_Logic.get_test_list({product_count:2,get_blank:false,fields:'delivery_time,apple,basnnah'})
200
203
  //let product_list = Product_Logic.get_test_list();
201
- Log.w('product_list',product_list);
204
+ //Log.w('product_list',product_list);
202
205
  //let [category_list,product_list]=Product.get_test_list_by_category({category_count:5,product_count:9});
203
206
  //Log.w('category_list',category_list);
204
207