Merge pull request #507 from nextcloud/bugfix/boost

Bugfix/boost
pull/515/head
Maxence Lange 2019-05-06 23:08:31 -01:00 zatwierdzone przez GitHub
commit 027004ea3e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 12 dodań i 3 usunięć

Wyświetl plik

@ -155,7 +155,7 @@ class NotesRequest extends NotesRequestBuilder {
$qb = $this->getNotesSelectSql();
$this->limitToIdString($qb, $id);
// $this->limitToType($qb, Note::TYPE);
$this->leftJoinCacheActors($qb, 'attributed_to');
if ($asViewer) {
$this->limitToViewer($qb);

Wyświetl plik

@ -98,6 +98,9 @@ export default {
},
formatedMessage() {
let message = this.item.content
if (typeof message === 'undefined') {
return ''
}
message = message.replace(/(?:\r\n|\r|\n)/g, '<br />')
message = message.linkify({
formatHref: {

Wyświetl plik

@ -53,6 +53,12 @@ const mutations = {
},
setAccount(state, account) {
state.account = account
},
boostPost(state, post) {
Vue.set(state.timeline[post.id].action.values, 'boosted', true)
},
unboostPost(state, post) {
Vue.set(state.timeline[post.id].action.values, 'boosted', false)
}
}
const getters = {
@ -100,7 +106,7 @@ const actions = {
postBoost(context, post) {
return new Promise((resolve, reject) => {
axios.post(OC.generateUrl(`apps/social/api/v1/post/boost?postId=${post.id}`)).then((response) => {
post.action.values.boosted = true
context.commit('boostPost', post)
// eslint-disable-next-line no-console
console.log('Post boosted with token ' + response.data.result.token)
resolve(response)
@ -113,7 +119,7 @@ const actions = {
},
postUnBoost(context, post) {
return axios.delete(OC.generateUrl(`apps/social/api/v1/post/boost?postId=${post.id}`)).then((response) => {
post.action.values.boosted = false
context.commit('unboostPost', post)
// eslint-disable-next-line no-console
console.log('Boost deleted with token ' + response.data.result.token)
}).catch((error) => {