FIX: Import 'ajax' instead.
This commit is contained in:
parent
49b77843fe
commit
9936707b0a
|
@ -3,6 +3,7 @@ import User from 'discourse/models/user';
|
||||||
import TopicStatus from 'discourse/views/topic-status';
|
import TopicStatus from 'discourse/views/topic-status';
|
||||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||||
import { withPluginApi } from 'discourse/lib/plugin-api';
|
import { withPluginApi } from 'discourse/lib/plugin-api';
|
||||||
|
import { ajax } from 'discourse/lib/ajax';
|
||||||
|
|
||||||
function clearAccepted(topic) {
|
function clearAccepted(topic) {
|
||||||
const posts = topic.get('postStream.posts');
|
const posts = topic.get('postStream.posts');
|
||||||
|
@ -26,7 +27,7 @@ function unacceptPost(post) {
|
||||||
});
|
});
|
||||||
topic.set('accepted_answer', undefined);
|
topic.set('accepted_answer', undefined);
|
||||||
|
|
||||||
Discourse.ajax("/solution/unaccept", {
|
ajax("/solution/unaccept", {
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: { id: post.get('id') }
|
data: { id: post.get('id') }
|
||||||
}).catch(popupAjaxError);
|
}).catch(popupAjaxError);
|
||||||
|
@ -48,7 +49,7 @@ function acceptPost(post) {
|
||||||
post_number: post.get('post_number')
|
post_number: post.get('post_number')
|
||||||
});
|
});
|
||||||
|
|
||||||
Discourse.ajax("/solution/accept", {
|
ajax("/solution/accept", {
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: { id: post.get('.id') }
|
data: { id: post.get('.id') }
|
||||||
}).catch(popupAjaxError);
|
}).catch(popupAjaxError);
|
||||||
|
|
Loading…
Reference in New Issue