diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-11-29 11:51:22 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-11-29 13:59:52 +0100 |
commit | 8204ce6299b340b0fc8deb0f3557be71315fab40 (patch) | |
tree | 7448e512df232d88172ba2bbc0ac5fb48a24330d /src/mixins | |
parent | 38c879ddc3e0b43d3d779913c956ce73a808ae65 (diff) |
Add mixin for follow/unfollow methods
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/mixins')
-rw-r--r-- | src/mixins/follow.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mixins/follow.js b/src/mixins/follow.js new file mode 100644 index 00000000..09fde974 --- /dev/null +++ b/src/mixins/follow.js @@ -0,0 +1,34 @@ +/* + * @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net> + * + * @author Julius Härtl <jus@bitgrid.net> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +import axios from 'nextcloud-axios' + +export default { + methods: { + follow() { + return axios.put(OC.generateUrl('/apps/social/api/v1/account/follow?account=' + this.item.account)) + }, + unfollow() { + return axios.delete(OC.generateUrl('/apps/social/api/v1/account/follow?account=' + this.item.account)) + } + } +} |