Mailisyorlik / artemisios

1 stars 0 forks source link

Don't allow a user to add the same tag more than once #30

Open colinloretz opened 10 years ago

colinloretz commented 10 years ago

Don't allow them to add the same tag on the same phone but also don't allow them to add the same tag if it's registered to another user.

We can add tag sharing later

Mailisyorlik commented 10 years ago

This function should be fairly similar to the one we did with the user being unable to add a tag without a name, correct?

colinloretz commented 10 years ago

Kind of. We need to check to see if a tag with that UUID, major and minor number already exists in Parse before we add a new one. So we have to query the tag objects with a uuid, major and minor number. If nothing returns, we can create a new one. If there is one already, we have to tell the user it is already registered to someone else (possibly themselves)

Mailisyorlik commented 10 years ago

Ah, okay, thats what I figured.

Mailisyorlik commented 10 years ago

One more question. Where in the code should this function be located?

colinloretz commented 10 years ago

in the New Tag controller, probably inside of SaveTag. You have to check first and then do what I mentioned above.

Mailisyorlik commented 10 years ago

Yeah thats what I thought. Thanks!