diff --git a/client/src/components/WidgetFooter.vue b/client/src/components/WidgetFooter.vue index 52c232b5..5a454d0a 100644 --- a/client/src/components/WidgetFooter.vue +++ b/client/src/components/WidgetFooter.vue @@ -1,41 +1,9 @@ - - diff --git a/client/src/components/portfolio/OwnerWidget.vue b/client/src/components/portfolio/OwnerWidget.vue index 0978ccf6..aab47e6d 100644 --- a/client/src/components/portfolio/OwnerWidget.vue +++ b/client/src/components/portfolio/OwnerWidget.vue @@ -1,6 +1,6 @@ diff --git a/client/src/components/rooms/WidgetPopover.vue b/client/src/components/rooms/WidgetPopover.vue index 5df364e0..31b0f57d 100644 --- a/client/src/components/rooms/WidgetPopover.vue +++ b/client/src/components/rooms/WidgetPopover.vue @@ -11,7 +11,7 @@ methods: { hidePopover() { this.$emit('hide-me'); - } + }, } } diff --git a/client/src/graphql/gql/mutations/updateProjectSharedState.gql b/client/src/graphql/gql/mutations/updateProjectSharedState.gql new file mode 100644 index 00000000..eb822a2a --- /dev/null +++ b/client/src/graphql/gql/mutations/updateProjectSharedState.gql @@ -0,0 +1,7 @@ +mutation UpdateProjectShareState($input: UpdateProjectSharedStateInput!) { + updateProjectSharedState(input: $input) { + errors + success + shared + } +} diff --git a/client/src/pages/portfolio.vue b/client/src/pages/portfolio.vue index 889e00ac..4b74e30d 100644 --- a/client/src/pages/portfolio.vue +++ b/client/src/pages/portfolio.vue @@ -7,9 +7,6 @@ v-for="project in projects" v-bind="project" :userId="userId" - @delete="deleteProject" - @updateShare="updateShareState" - @edit="editProject" :key="project.id" class="portfolio__project" > @@ -23,8 +20,6 @@ import ME_QUERY from '@/graphql/gql/meQuery.gql'; import PROJECTS_QUERY from '@/graphql/gql/allProjects.gql'; - import DELETE_PROJECT_MUTATION from '@/graphql/gql/mutations/deleteProject.gql'; - import UPDATE_PROJECT_MUTATION from '@/graphql/gql/mutations/updateProject.gql'; export default { components: { @@ -57,50 +52,6 @@ return this.me.id; } }, - - methods: { - deleteProject(id) { - this.$apollo.mutate({ - mutation: DELETE_PROJECT_MUTATION, - variables: { - input: { - id - } - }, - update(store, {data: {deleteProject: {success}}}) { - if (success) { - const data = store.readQuery({query: PROJECTS_QUERY}); - - if (data) { - data.projects.edges.splice(data.projects.edges.findIndex(edge => edge.node.id === id), 1); - store.writeQuery({query: PROJECTS_QUERY, data}); - } - } - } - }) - }, - editProject(id) { - this.$router.push({name: 'edit-project', params: {id}}); - }, - updateShareState(id, state) { - const project = this.projects.filter(project => project.id === id)[0]; - this.$apollo.mutate({ - mutation: UPDATE_PROJECT_MUTATION, - variables: { - input: { - project: { - id: project.id, - title: project.title, - description: project.description, - appearance: project.appearance, - objectives: project.objectives, - final: state - } - } - } - }) - } - } } diff --git a/client/src/pages/project.vue b/client/src/pages/project.vue index fd7dd0dc..1ac73b1e 100644 --- a/client/src/pages/project.vue +++ b/client/src/pages/project.vue @@ -11,9 +11,16 @@