cloud-code

Parse CloudCode SetPassword Always Fails

六月ゝ 毕业季﹏ 提交于 2019-12-11 17:47:51
问题 I want to include functionality to allow users to change their password in Parse within my app. I am using Unity version 5.0.2f1 and building for WebGL. I attempted to use the Parse plugin to handle this, which worked great in the Unity editor, but once I built the app for WebGL, it would no longer work, always returning a BAD REQUEST. Thus, it looked like the only solution was to attempt to use CloudCode to do it. However, I'm finding that I cannot ever successfully change a password through

Cloud Code function not saving data

僤鯓⒐⒋嵵緔 提交于 2019-12-11 15:05:35
问题 Before putting this on the cloud code I tested it in Angular with success producing the correct console.log responses throughout the program. Since this function manipulates data in the user table it must use the master key and be in cloud code. With this code in the cloud it saves the column 'duty' to the user table but with no data (there is data to be saved, this I am sure of). Moreover, I'm not even sure that the code runs past the first Parse Query as the console.log returns nothing in

Parse-Server Cloud-Code and Stripe

旧巷老猫 提交于 2019-12-11 13:47:22
问题 I'm running a Parse-Server instance for a mobile web-app on Heroku. My problem is Stripe checkout plugin is working fine in my html page, but when the token is created and I call my Cloud Code it seems as if creating the variable initializing stripe does nothing. This is my cloud code. var stripe = require('stripe')('sk_test_******'); Parse.Cloud.define("pay", function(req, res){ Parse.Cloud.useMasterKey(); var token = req.params.token; var amount = req.params.amount; var email = req.params

Using a function more directly in a promise

天涯浪子 提交于 2019-12-11 12:45:13
问题 Is there a way to express this: imagePFFileFromUrl(exampUrl) // (returns a promise) .then(function(xxx)) // that syntax gives you the results of the // imagePFFileFromUrl inside the variable xxx. // I then use it in another function which // returns another promise... { return saveImageFile(xxx, anotherArgument) // (returns a promise) }) .then(function(savedPFFile) more like this .. imagePFFileFromUrl(exampUrl) .then(saveImageFile(...the results from imagePFFileFromUrl ...)) .then(function

Parse Javascript API Cloud Code afterSave with access to beforeSave values

馋奶兔 提交于 2019-12-11 12:28:37
问题 I'm using Parse Cloud Code to do before/afterSave processing. I'd check the beforeSave value of an attribute in the afterSave hook - for example, do something when parseObj.get('status') transitions from processing => complete . I can get access to the oldVal/newVal for changed attributes in the beforeSave handler, but I can't find a way to pass the oldVal to the afterSave handler without saving as a DB field. I tried to pass the values as an attribute to the response and response.object

delete objects inParse after a set amount of time from a specific class

寵の児 提交于 2019-12-11 11:13:33
问题 Hello I have an app that would upload photo's to the sever. Parse only gives us 20gb for storage and so I don't want to go over that limit. I want the server so that it would delete the files if it is 3 days old. So this is the code Parse.Cloud.job('deleteOldPosts', function(request, status) { // All access Parse.Cloud.useMasterKey(); var today = new Date(); var days = 10; var time = (days * 24 * 3600 * 1000); var expirationDate = new Date(today.getTime() - (time)); var query = new Parse

Aftersave Cloud Function for Parse that increments value in another data table?

孤人 提交于 2019-12-11 09:47:47
问题 I'm having trouble getting my aftersave cloud function to increment a value in another data table. The Parse documentation is a bit confusing on this front. I have a table called "CandidateVotes" that stores a row for each vote on a "candidate" - and when a new vote row is saved, I would like to increment the total votes count stored in a different table called "CategoryCandidates" which has a row for each "candidate". So the relevant information: Votes table is called "CandidateVotes"

Returning deeper relations in Parse Cloud Code when using promises

谁说我不能喝 提交于 2019-12-11 09:47:02
问题 I have received some excellent information on Parse promises so far and am ready to soak up the next bit of the puzzle to me... relations of relations. The following code is in most part in answering Issues with Parse Cloud Code Promises but I have in the comments of the sections piece of code my next question. How would I go about further querying of relations within the top level relations? would be great to see how you would extend you code to do that @roamer-1888 Latest: //Return a single

Parse Swift IOS - PFCloud callFunctionInBackground Selector not invoked

眉间皱痕 提交于 2019-12-11 08:47:49
问题 When i call the PFcloud function from normal it return the correct count how ever when i call it with selector, the selector call back function is not fired, Appreciate if any can can point to me what is the mistake in my code. Working block - it print out the count successfully PFCloud.callFunctionInBackground(CloudFunctions.getBookingCount, withParameters: ["camp": "pmAwLDTNc6"], block: { (result: AnyObject!, error: NSError!) -> Void in if ( error === nil) { NSLog("Booking Count call back:

Parse Push Notification Cloud Code Error?

こ雲淡風輕ζ 提交于 2019-12-11 05:03:22
问题 UPDATE: I was getting this error because of a bug that Parse-Server 2.2.17 has. I fixed it by going back to 2.2.16. Does anyone know why I am getting this error? Here is my cloud code: `Parse.Cloud.define("Messages", function(request, response) { var pushQuery = new Parse.Query(Parse.Installation); Parse.Push.send({ where: pushQuery, data: { alert: "New Event Added", sound: "default" } },{ success: function(){ console.log("Push Sent!") }, error: function (error) { console.log(error) },