FIX: Import 'ajax' instead.

This commit is contained in:
Rafael dos Santos Silva 2016-11-01 11:25:57 -02:00
parent 49b77843fe
commit 9936707b0a
1 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import User from 'discourse/models/user';
import TopicStatus from 'discourse/views/topic-status';
import { popupAjaxError } from 'discourse/lib/ajax-error';
import { withPluginApi } from 'discourse/lib/plugin-api';
import { ajax } from 'discourse/lib/ajax';
function clearAccepted(topic) {
const posts = topic.get('postStream.posts');
@ -26,7 +27,7 @@ function unacceptPost(post) {
});
topic.set('accepted_answer', undefined);
Discourse.ajax("/solution/unaccept", {
ajax("/solution/unaccept", {
type: 'POST',
data: { id: post.get('id') }
}).catch(popupAjaxError);
@ -48,7 +49,7 @@ function acceptPost(post) {
post_number: post.get('post_number')
});
Discourse.ajax("/solution/accept", {
ajax("/solution/accept", {
type: 'POST',
data: { id: post.get('.id') }
}).catch(popupAjaxError);