apavlidi / IT_API

The Internet services of the IT department of Alexander Technological Education Institute of Thessaloniki
http://api.it.teithe.gr/
MIT License
14 stars 5 forks source link

PUT /categories/register #55

Closed iamraf closed 5 years ago

iamraf commented 5 years ago

On DOC categoriesRegistered and categoriesNotRegistered do not exist. Instead addCat and removeCat and the correct fields.

iamraf commented 5 years ago

It doesn't seem to work anyway, I keep receive 500 code. Need more info about this.

@apavlidi @kvisnia

{"addCat":["591ca2b75c39e553cdf0a511"],"removeCat":["591ca2b75c39e553cdf0a510"]}

More Variations:

{"addCat":["591ca2b75c39e553cdf0a511","591ca2b75c39e553cdf0a512"],"removeCat":[]} {"addCat":[],"removeCat":["591ca2b75c39e553cdf0a510"]}

NOTE: I am adding non registered categories and removing registered. Probably a bug?

{"error":{"message":"Σφάλμα κατα την ενημέρωση.","type":"updateRegistrationToCategories","code":1242}}

apavlidi commented 5 years ago

@h01d Here is an example of usage: data: { addCat: JSON.stringify(['59ab445c3eb44c2c608cb18b']), removeCat: JSON.stringify([]) }

This is a tricky one cause arrays need to be stringify first in order to send them.The documentation is missing for this so we apologize for the trouble. Documentation will be updated after this.