MCPcopy
hub / github.com/parse-community/parse-server-example / postData

Function postData

public/assets/js/script.js:61–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 * Parse Requests
60 */
61const postData = async () => {
62 try {
63 const gameScore = new Parse.Object('GameScore');
64 gameScore.set('score', 1337);
65 gameScore.set('playerName', 'Sean Plott');
66 gameScore.set('cheatMode', false);
67
68 const result = await gameScore.save();
69 Store.objectId = result.id;
70
71 closeStep('#step-1');
72 fillStepOutput('#step-1-output', JSON.stringify(result));
73 fillBtn('#step-1-btn', 'Posted');
74 openStep('#step-2');
75
76 bindBtn('#step-2-btn', async (e) => {
77 e.preventDefault();
78 await getData();
79 });
80 } catch (error) {
81 fillStepError('#step-1-error', `There was a failure: ${error.message}`);
82 }
83};
84
85const getData = async () => {
86 try {

Callers 1

initFunction · 0.85

Calls 7

closeStepFunction · 0.85
fillStepOutputFunction · 0.85
fillBtnFunction · 0.85
openStepFunction · 0.85
bindBtnFunction · 0.85
getDataFunction · 0.85
fillStepErrorFunction · 0.85

Tested by

no test coverage detected