Merge "Add collation for Abkhaz (ab)"
[lhc/web/wiklou.git] / resources / src / mediawiki / api.js
index 0e9c19b..2e5a92e 100644 (file)
@@ -42,7 +42,7 @@
                        'import',
                        'options'
                ];
-               if ( $.inArray( action, csrfActions ) !== -1 ) {
+               if ( csrfActions.indexOf( action ) !== -1 ) {
                        mw.track( 'mw.deprecate', 'apitoken_' + action );
                        mw.log.warn( 'Use of the "' + action + '" token is deprecated. Use "csrf" instead.' );
                        return 'csrf';
                                        return abortedPromise;
                                }
 
-                               return ( abortable = api.post( params, ajaxOptions ) ).then(
-                                       // If no error, return to caller as-is
-                                       null,
+                               return ( abortable = api.post( params, ajaxOptions ) ).catch(
                                        // Error handler
                                        function ( code ) {
                                                if ( code === 'badtoken' ) {