From f51ad1131b68c2ef97f8a9c7889061ae5fc83807 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 11 Nov 2019 19:16:07 +0100 Subject: [PATCH] UpdateDonations from admin/donations @alina-beck I'm not 100% satisfied with this at the moment. I think that the admin could have the goal and progress initialized from a query for the Donations, and be able to update if one of them changed... what do you think? --- webapp/graphql/Donations.js | 14 ++++++++++++++ webapp/pages/admin/donations.vue | 21 +++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 webapp/graphql/Donations.js diff --git a/webapp/graphql/Donations.js b/webapp/graphql/Donations.js new file mode 100644 index 000000000..472218458 --- /dev/null +++ b/webapp/graphql/Donations.js @@ -0,0 +1,14 @@ +import gql from 'graphql-tag' + +export const UpdateDonations = () => { + return gql` + mutation($goal: Int, $progress: Int) { + UpdateDonations(goal: $goal, progress: $progress) { + id + goal + progress + updatedAt + } + } + ` +} diff --git a/webapp/pages/admin/donations.vue b/webapp/pages/admin/donations.vue index 5043ceaec..2eb7b92f9 100644 --- a/webapp/pages/admin/donations.vue +++ b/webapp/pages/admin/donations.vue @@ -16,19 +16,32 @@