Remove unnecessary contentType: 'multipart/form-data' from an API query

This was copied from somewhere else (probably VisualEditor), but it is
not needed here.

Using the multipart/form-data encoding is beneficial when sending long
binary data (such as the compressed HTML VisualEditor sends), and is
also required when uploading files, but it is not helpful when sending
a short query like we do here.

Also rename a variable.

Change-Id: I9bcce2ce1ca7c218e4cd147960d1070dd23ea9fa
This commit is contained in:
Bartosz Dziewoński 2021-08-16 21:33:59 +02:00
parent 4c103576e8
commit a129899971

View file

@ -271,8 +271,8 @@ function initTopicSubscriptions( $container ) {
page: title,
commentname: commentName,
subscribe: !isSubscribed
}, { contentType: 'multipart/form-data' } ).then( function ( response2 ) {
return OO.getProp( response2, 'discussiontoolssubscribe' ) || {};
} ).then( function ( response ) {
return OO.getProp( response, 'discussiontoolssubscribe' ) || {};
} ).then( function ( result ) {
if ( result.subscribe ) {
element.setAttribute( 'data-mw-subscribed', '' );