You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was playing with your API and it's great. There's a few bugs I've noticed tough:
faceApi.tagsService.save( tid , "franck_ribery@nstuto" );
Calling this method should dispatch FaceEvent.TAG_SAVED or similar, rather than FaceEvent.SUCCESS as the response content is different.
Also the event should handle XML request as well, it triggers error at the moment.
I just did a quick hack to handle different response types and formats:
private function loaderCompleteHandler( evt : Event ) : void
{
var result:*;
if (evt.target.data.indexOf('<?xml version="1.0" encoding="utf-8"?>') == -1)
{
result = JSON.decode( evt.target.data );
} else {
result = new XML( evt.target.data );
}
if (evt.target.data.indexOf('saved_tags') == -1)
{
dispatchEvent( new FaceEvent( FaceEvent.SUCCESS , result , evt.target.data , new FaceResult( result ) ));
} else {
dispatchEvent( new FaceEvent( FaceEvent.TAG_SAVED , result , evt.target.data , new FaceResult( result ) ));
}
}
Perhaps you might want to solve it another way, or group responses by type?
Cheers,
Tomek
The text was updated successfully, but these errors were encountered:
Hey Jean!
I was playing with your API and it's great. There's a few bugs I've noticed tough:
Calling this method should dispatch FaceEvent.TAG_SAVED or similar, rather than FaceEvent.SUCCESS as the response content is different.
Also the event should handle XML request as well, it triggers error at the moment.
I just did a quick hack to handle different response types and formats:
Perhaps you might want to solve it another way, or group responses by type?
Cheers,
Tomek
The text was updated successfully, but these errors were encountered: