hola-server 1.0.3 → 1.0.5

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 (2) hide show
  1. package/db/entity.js +4 -4
  2. package/package.json +1 -1
package/db/entity.js CHANGED
@@ -258,7 +258,7 @@ class Entity {
258
258
  * @returns object with code and err
259
259
  */
260
260
  async create_entity(param_obj, view) {
261
- const fields = view == "*" ? this.meta.create_fields : this.meta.create_fields.filter(field => field.view == view);
261
+ const fields = view == "*" ? this.meta.create_fields : this.meta.create_fields.filter(field => field.view == view || field.view == "*");
262
262
  const { obj, error_field_names } = convert_type(param_obj, fields);
263
263
  if (error_field_names.length > 0) {
264
264
  if (is_log_error()) {
@@ -421,7 +421,7 @@ class Entity {
421
421
  *
422
422
  */
423
423
  async update_entity(_id, param_obj, view) {
424
- const fields = view == "*" ? this.meta.update_fields : this.meta.update_fields.filter(field => field.view == view);
424
+ const fields = view == "*" ? this.meta.update_fields : this.meta.update_fields.filter(field => field.view == view || field.view == "*");
425
425
 
426
426
  const { obj, error_field_names } = convert_update_type(param_obj, fields);
427
427
  if (error_field_names.length > 0) {
@@ -580,7 +580,7 @@ class Entity {
580
580
  }
581
581
 
582
582
  const field_names = this.meta.property_fields.map(f => f.name);
583
- const attrs = {};
583
+ const attrs = { _id: 1 };
584
584
  attr_names.split(",").forEach((attr) => {
585
585
  if (field_names.includes(attr)) {
586
586
  attrs[attr] = 1;
@@ -624,7 +624,7 @@ class Entity {
624
624
  const field_names = this.meta.property_fields.map(f => f.name);
625
625
  const ref_fields = [];
626
626
  const link_fields = [];
627
- const attrs = {};
627
+ const attrs = { _id: 1 };
628
628
 
629
629
  const fields_map = this.meta.fields_map;
630
630
  attr_names.split(",").forEach((attr) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hola-server",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "a meta programming framework used to build nodejs restful api",
5
5
  "main": "index.js",
6
6
  "scripts": {