Commit dd20613c authored by Clement Ho's avatar Clement Ho

[skip ci] remove additional promise for vueresource

parent 34f689e4
......@@ -7,10 +7,12 @@ export default {
methods: {
assignSelf() {
this.service.add(this.assignees.currentUser.id).then((response) => {
const assignee = response.assignee;
const data = response.data;
const assignee = data.assignee;
this.assignees.addUser(assignee.name, assignee.username, assignee.avatar_url);
}).catch((err) => {
console.log('error')
console.log(err);
console.log('error');
});
}
},
......
......@@ -5,7 +5,7 @@ export default {
},
template: `
<div class="value hide-collapsed">
<a class="author_link bold" :href="user.url">
<a class="author_link bold" :href="'/' + user.username">
<img width="32" class="avatar avatar-inline s32" alt="" :src="user.avatarUrl">
<span class="author">{{user.name}}</span>
<span class="username">@{{user.username}}</span>
......
......@@ -3,7 +3,6 @@ import VueResource from 'vue-resource';
require('~/vue_shared/vue_resource_interceptor');
Vue.http.options.emulateJSON = true;
Vue.use(VueResource);
export default class SidebarAssigneesService {
......@@ -13,13 +12,10 @@ export default class SidebarAssigneesService {
}
add(userId) {
return new Promise((resolve, reject) => {
this.sidebarAssigneeResource.update({ [this.field]: userId })
.then((response) => {
resolve(JSON.parse(response.body))
}, (response) => {
reject(response)
});
return this.sidebarAssigneeResource.update({
[this.field]: userId
}, {
emulateJSON: true
});
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment