skapi-js 1.0.8 → 1.0.9

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/js/main/skapi.js CHANGED
@@ -22,7 +22,7 @@ export default class Skapi {
22
22
  set user(value) {
23
23
  }
24
24
  constructor(service, owner, options) {
25
- this.version = '1.0.8';
25
+ this.version = '1.0.9';
26
26
  this.session = null;
27
27
  this.connection = null;
28
28
  this.host = 'skapi';
@@ -1007,17 +1007,19 @@ export async function deleteRecords(params) {
1007
1007
  },
1008
1008
  };
1009
1009
  let table_p = validator.Params(params.table || {}, struct, isAdmin ? [] : ['name']);
1010
- if (table_p.subscription === null) {
1011
- delete table_p.subscription;
1012
- }
1013
- else {
1014
- if (!table_p.hasOwnProperty('access_group')) {
1015
- throw new SkapiError('"table.access_group" is required for subscription records.', { code: 'INVALID_PARAMETER' });
1010
+ if (table_p.hasOwnProperty('subscription')) {
1011
+ if (table_p.subscription === null) {
1012
+ delete table_p.subscription;
1016
1013
  }
1017
- else if (table_p.access_group === 0) {
1018
- throw new SkapiError('Public tables does not hold subscription records.', { code: 'INVALID_REQUEST' });
1014
+ else {
1015
+ if (!table_p.hasOwnProperty('access_group')) {
1016
+ throw new SkapiError('"table.access_group" is required for subscription records.', { code: 'INVALID_PARAMETER' });
1017
+ }
1018
+ else if (table_p.access_group === 0) {
1019
+ throw new SkapiError('Public tables does not hold subscription records.', { code: 'INVALID_REQUEST' });
1020
+ }
1021
+ table_p.subscription_group = 1;
1019
1022
  }
1020
- table_p.subscription_group = 1;
1021
1023
  }
1022
1024
  params.table = table_p;
1023
1025
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skapi-js",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Javascript library for Skapi: Complete JAM Stack, front-end driven serverless backend API service.",
5
5
  "main": "./dist/skapi.module.js",
6
6
  "types": "./js/Main.d.ts",