biz9-logic 4.8.368 → 4.8.370

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 +20 -17
  3. package/package.json +1 -1
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='8.4.8'
1
+ VERSION='8.5.0'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -193,6 +193,7 @@ class Type {
193
193
  * get_plural = ex. true,false / def. false
194
194
  * get_url = ex. true,false / def. false
195
195
  */
196
+ type = type?type:"";
196
197
  let r_type = "";
197
198
  option = option ? option : {get_lowercase:false,get_plural:false,get_url:false};
198
199
  switch(type){
@@ -1384,23 +1385,6 @@ class User_Logic {
1384
1385
  req.session.user=null;
1385
1386
  delete req.session.user;
1386
1387
  }
1387
- static get_not_found = (user_id,option) =>{
1388
- if(!user_id){
1389
- user_id=0;
1390
- }
1391
- let user = User_Logic.get_test("",{get_blank:true})
1392
- user.id = 0;
1393
- user.id_key = user_id;
1394
- user.title = "User Not Found";
1395
- user.first_name = "User Not Found";
1396
- user.title_url = Str.get_title_url(user.title);
1397
- user.images = [];
1398
- user.items = [];
1399
- if(option.app_id){
1400
- user.app_id = option.app_id;
1401
- }
1402
- return user;
1403
- };
1404
1388
  static get_test = (title,option) =>{
1405
1389
  [title,option] = Field_Logic.get_option_title(title,option);
1406
1390
  option = Field_Logic.get_option(DataType.USER,option?option:{});
@@ -1504,6 +1488,7 @@ class App_Logic {
1504
1488
  return {data_type:data_type,filter:filter,sort_by:sort_by,page_current:page_current,page_size:page_size};
1505
1489
  }
1506
1490
  static get_not_found = (data_type,id,option) =>{
1491
+ if(data_type != DataType.USER){
1507
1492
  if(!id){
1508
1493
  id=0;
1509
1494
  }
@@ -1518,6 +1503,24 @@ class App_Logic {
1518
1503
  item.app_id = option.app_id;
1519
1504
  }
1520
1505
  return item;
1506
+ }else{
1507
+ if(!user_id){
1508
+ user_id=0;
1509
+ }
1510
+ let user = User_Logic.get_test("",{get_blank:true})
1511
+ user.id = 0;
1512
+ user.id_key = user_id;
1513
+ user.title = "User Not Found";
1514
+ user.first_name = "User Not Found";
1515
+ user.title_url = Str.get_title_url(user.title);
1516
+ user.images = [];
1517
+ user.items = [];
1518
+ if(option.app_id){
1519
+ user.app_id = option.app_id;
1520
+ }
1521
+ return user;
1522
+ }
1523
+
1521
1524
  };
1522
1525
  static get_search_query(search){
1523
1526
  let url = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.8.368",
3
+ "version": "4.8.370",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"