Mailisyorlik / artemisios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

colinloretz opened this issue · comments

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

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

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)

Ah, okay, thats what I figured.

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

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

Yeah thats what I thought. Thanks!