Skip to content

Commit be641ad

Browse files
committed
simplify changes
1 parent 4167898 commit be641ad

File tree

15 files changed

+23
-199
lines changed

15 files changed

+23
-199
lines changed

cloud/TestObject/beforeSave.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

cloud/TestObject/schema.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

cloud/Hello/functions.js renamed to cloud/functions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ Parse.Cloud.define('helloAsyncFunction', async req => {
88
req.log.info(req);
99
return 'Hi async';
1010
});
11+
12+
Parse.Cloud.beforeSave('TestObject', () => {
13+
throw new Parse.Error(9001, 'Saving test objects is not available.');
14+
});

cloud/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// It is best practise to organize your cloud functions group into their own file. You can then import them in your main.js.
22
await Promise.all([
3-
import('./Hello/functions.js'),
4-
import('./TestObject/beforeSave.js')
3+
import('./functions.js')
54
]);

cloud/schema.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
import { TestObjectSchema } from "./TestObject/schema.js";
2-
export const schemaDefinitions = [TestObjectSchema];
1+
export const schemaDefinitions = [{
2+
className: "TestObject",
3+
fields: {
4+
beforeSave: { type: "Boolean", defaultValue: false },
5+
additionalData: { type: "String" },
6+
},
7+
classLevelPermissions: {
8+
find: { "*": true },
9+
count: { "*": true },
10+
get: { "*": true },
11+
update: { "*": true },
12+
create: { "*": true },
13+
delete: { "*": true },
14+
},
15+
}];

jest.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

jest.setup.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
"lint-fix": "eslint --cache --fix ./cloud && eslint --cache --fix index.js && eslint --cache --fix ./e2e",
1515
"prettier": "prettier --write '{cloud,e2e}/{**/*,*}.js' 'index.js'",
1616
"start": "node index.js",
17-
"pretest:e2e": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=7.0.1} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017",
18-
"test:unit": "node --experimental-vm-modules node_modules/jest/bin/jest.js tests/",
19-
"test:e2e": "TESTING=true jasmine",
20-
"test": "npm run test:unit && npm run test:e2e",
17+
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=7.0.1} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017",
18+
"test": "TESTING=true jasmine",
2119
"posttest:e2e": "mongodb-runner stop --all",
2220
"watch": "nodemon index.js"
2321
},
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)