This is a migrated thread and some comments may be shown as answers.

Where can I find the details about the cloud code request parameters?

1 Answer 14 Views
Cloud Code
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ptw
Top achievements
Rank 1
ptw asked on 29 Nov 2016, 01:42 PM

Hi,

I'm looking for a list  of the request key-values that define CRUD / Data Type events. Does anyone know what they are or where I can find them?

 

Here's what I mean ...

The request object in a Cloud Code event (e.g. afterDelete on a Data Type) contains some properties and values that explain the type of request being made. For example:

On a data.destroySingle action, the request include the following key-value pairs:

action: "DELETE"
specificAction: "DeleteById"

And for data.destroy(filter) action, the following:

action: "DELETE"
specificAction: "DeleteByFilter"

 

I'm looking for the equivalent key-value pairs that define other CRUD actions (data.create, data.save, data.update etc).

And just in case it helps any of you out there, here's why / how I'm using this ...

I'm changing object ACL permissions and deleting/creating some data items on certain data events. To do this I need to identify the type of request - and thereby know where I can find important parameters within the request object. For example, assuming a request is about a single item (e.g. data.destroySingle) when it's actually a set of items (data.destroy(filter)) leads to errors.

 

Thanks & hope that helps

-Paul

 

 

 

1 Answer, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 30 Nov 2016, 01:46 PM
Hello Paul,

You can find a reference of the Cloud Code parameters here. In brief, the other CRUD operations will follow a similar notation like "GetById", "GetByFilter", etc.

In addition, my suggestion would be to check the knowledge base topics for Business Logic for similar cases. They are available as a FAQ section with links to the respective article here. My idea when suggesting this is that you may need to add a numerous checks within the code to ensure that the request completed successfully, the user making the request, if the request contains an item Id or is utilizing a filter and so on. These may be more beneficial and applicable instead of verifying for the request action.

Let me know if you have questions.

EDIT: The second link was edited.

Regards,
Anton Dobrev
Telerik by Progress
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
Cloud Code
Asked by
ptw
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Share this question
or