biz9-logic 4.8.367 → 4.8.369

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.
Files changed (3) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +36 -34
  3. package/package.json +1 -1
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='8.4.7'
1
+ VERSION='8.4.9'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -47,23 +47,7 @@ class Item_Logic {
47
47
  }
48
48
  return item;
49
49
  }
50
- static get_not_found = (data_type,id,option) =>{
51
- if(!id){
52
- id=0;
53
- }
54
- let item = Item_Logic.get_test("",data_type,id,{get_blank:true})
55
- item.id = 0;
56
- item.id_key = id;
57
- item.title = "Item Not Found";
58
- item.title_url = Str.get_title_url(item.title);
59
- item.images = [];
60
- item.items = [];
61
- if(option.app_id){
62
- item.app_id = option.app_id;
63
- }
64
- return item;
65
- };
66
- static get_test_list = (data_type,option) =>{
50
+ static get_test_list = (data_type,option) =>{
67
51
  option = Field_Logic.get_option(data_type,option?option:{});
68
52
  let item_list = [];
69
53
  for(let a=0;a<option.item_count+1;a++){
@@ -1400,23 +1384,6 @@ class User_Logic {
1400
1384
  req.session.user=null;
1401
1385
  delete req.session.user;
1402
1386
  }
1403
- static get_not_found = (user_id,option) =>{
1404
- if(!user_id){
1405
- user_id=0;
1406
- }
1407
- let user = User_Logic.get_test("",{get_blank:true})
1408
- user.id = 0;
1409
- user.id_key = user_id;
1410
- user.title = "User Not Found";
1411
- user.first_name = "User Not Found";
1412
- user.title_url = Str.get_title_url(user.title);
1413
- user.images = [];
1414
- user.items = [];
1415
- if(option.app_id){
1416
- user.app_id = option.app_id;
1417
- }
1418
- return user;
1419
- };
1420
1387
  static get_test = (title,option) =>{
1421
1388
  [title,option] = Field_Logic.get_option_title(title,option);
1422
1389
  option = Field_Logic.get_option(DataType.USER,option?option:{});
@@ -1519,6 +1486,41 @@ class App_Logic {
1519
1486
  static get_search = (data_type,filter,sort_by,page_current,page_size) => {
1520
1487
  return {data_type:data_type,filter:filter,sort_by:sort_by,page_current:page_current,page_size:page_size};
1521
1488
  }
1489
+ static get_not_found = (data_type,id,option) =>{
1490
+ if(data_type != DataType.USER){
1491
+ if(!id){
1492
+ id=0;
1493
+ }
1494
+ let item = Item_Logic.get_test("",data_type,id,{get_blank:true})
1495
+ item.id = 0;
1496
+ item.id_key = id;
1497
+ item.title = "Item Not Found";
1498
+ item.title_url = Str.get_title_url(item.title);
1499
+ item.images = [];
1500
+ item.items = [];
1501
+ if(option.app_id){
1502
+ item.app_id = option.app_id;
1503
+ }
1504
+ return item;
1505
+ }else{
1506
+ if(!user_id){
1507
+ user_id=0;
1508
+ }
1509
+ let user = User_Logic.get_test("",{get_blank:true})
1510
+ user.id = 0;
1511
+ user.id_key = user_id;
1512
+ user.title = "User Not Found";
1513
+ user.first_name = "User Not Found";
1514
+ user.title_url = Str.get_title_url(user.title);
1515
+ user.images = [];
1516
+ user.items = [];
1517
+ if(option.app_id){
1518
+ user.app_id = option.app_id;
1519
+ }
1520
+ return user;
1521
+ }
1522
+
1523
+ };
1522
1524
  static get_search_query(search){
1523
1525
  let url = "";
1524
1526
  if(search.data_type){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.8.367",
3
+ "version": "4.8.369",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"