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/dist/skapi.js +1 -1
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.module.js +1 -1
- package/dist/skapi.module.js.map +1 -1
- package/js/main/skapi.js +1 -1
- package/js/methods/database.js +11 -9
- package/package.json +1 -1
package/js/main/skapi.js
CHANGED
package/js/methods/database.js
CHANGED
|
@@ -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
|
|
1011
|
-
|
|
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
|
|
1018
|
-
|
|
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