kopia lustrzana https://github.com/nextcloud/social
👌 IMPROVE: immediate UI feedback / button change for successful boost/unboost
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>pull/462/head
rodzic
cb408e8fb3
commit
d9c37be5ec
src/store
|
@ -99,6 +99,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
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Post boosted with token ' + response.data.result.token)
|
||||
resolve(response)
|
||||
|
@ -112,6 +113,7 @@ const actions = {
|
|||
postUnBoost(context, post) {
|
||||
return axios.delete(OC.generateUrl(`apps/social/api/v1/post/boost?postId=${post.id}`)).then((response) => {
|
||||
context.commit('removeBoost', post)
|
||||
post.action.values.boosted = false
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Boost deleted with token ' + response.data.result.token)
|
||||
}).catch((error) => {
|
||||
|
|
Ładowanie…
Reference in New Issue