add publish/unpublish

parent bc80dfaf
......@@ -34,9 +34,13 @@
:image="vp.icon"
:url="vp.url"
type="Viewpoint Collection"
csstype="ViewpointCollection"
:csstype="vp.is_visible ? 'ViewpointCollection' : 'private'"
:btn-edit-modal="user === vp.owner"
@showEdit="showEdit(vp)"
:btn-publish="!vp.is_visible"
:btn-un-publish="vp.is_visible"
@publish="publish(vp)"
@unpublish="publish(vp)"
>{{ vp.introduction }}
</card>
</span>
......@@ -68,9 +72,18 @@ export default {
},
methods: {
publish(vp) {
let vm = this;
API.post('/viewpoints/toggle/visibility', {
collection: vp.uuid,
session: this.$store.getters['user/session']
}).then(() => {
vm.reload();
});
},
showEdit(e) {
this.current = e;
console.log('showEdit: ', e);
this.toggleForm = true;
this.action = 'Edit';
},
......@@ -80,6 +93,7 @@ export default {
this.action = 'Add';
this.toggleForm = true;
},
reload(toggle = false) {
//this.$q.notify({ message: 'RELOADED', position: 'center' });
return API.get('/viewpoints/')
......
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