skapi-js 1.0.6 → 1.0.8
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 +12 -0
- package/package.json +1 -1
package/js/main/skapi.js
CHANGED
package/js/methods/database.js
CHANGED
|
@@ -747,6 +747,12 @@ export async function postRecord(form, config) {
|
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
if (config_chkd.table?.subscription) {
|
|
750
|
+
if (!config_chkd?.record_id && !config_chkd.table?.access_group) {
|
|
751
|
+
throw new SkapiError('Public records cannot require subscription.', { code: 'INVALID_REQUEST' });
|
|
752
|
+
}
|
|
753
|
+
if (config_chkd.table.access_group === 0) {
|
|
754
|
+
throw new SkapiError('Public records cannot require subscription.', { code: 'INVALID_REQUEST' });
|
|
755
|
+
}
|
|
750
756
|
config_chkd.table.subscription_group = 1;
|
|
751
757
|
delete config_chkd.table.subscription;
|
|
752
758
|
}
|
|
@@ -1005,6 +1011,12 @@ export async function deleteRecords(params) {
|
|
|
1005
1011
|
delete table_p.subscription;
|
|
1006
1012
|
}
|
|
1007
1013
|
else {
|
|
1014
|
+
if (!table_p.hasOwnProperty('access_group')) {
|
|
1015
|
+
throw new SkapiError('"table.access_group" is required for subscription records.', { code: 'INVALID_PARAMETER' });
|
|
1016
|
+
}
|
|
1017
|
+
else if (table_p.access_group === 0) {
|
|
1018
|
+
throw new SkapiError('Public tables does not hold subscription records.', { code: 'INVALID_REQUEST' });
|
|
1019
|
+
}
|
|
1008
1020
|
table_p.subscription_group = 1;
|
|
1009
1021
|
}
|
|
1010
1022
|
params.table = table_p;
|
package/package.json
CHANGED