Mark Wong
Posts: 0
Joined: Sat Feb 14, 2015 7:47 am

Block the create service when there is the same information you're trying to create

For example, if I have a list of names which get from the user collection, and when I click on the list item, then it will create a new row with the current user name and the name on the list item in another collection.
What I want to achieve is if there is already a row with your user name and your target name, then you cannot create a new one anymore,
How should I do that?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Block the create service when there is the same information you're trying to create

Here is a brief plan:

When create item you should:

  1. Query db collection whether record already exists.
  2. If yes - you return error and do not execute create service.
  3. If not - you run create service .
Mark Wong
Posts: 0
Joined: Sat Feb 14, 2015 7:47 am

Block the create service when there is the same information you're trying to create

How do I set the query service to check whether did anything return?
Because whatever the where query is, the status is still 200 ok.
So I can't set the create service execute when error, because everytime is success

Mark Wong
Posts: 0
Joined: Sat Feb 14, 2015 7:47 am

Block the create service when there is the same information you're trying to create

I've use the response to map the hidden label and compare the value,
Answered!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Block the create service when there is the same information you're trying to create

Hi Mark,

Thanks for this update.

Regards.

Return to “Issues”