From 988748899e8a648db739a0e15c110a50a88a169b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 4 Jun 2019 21:31:43 +0100 Subject: [PATCH] Display a confirmation message --- src/components/SessionForm.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/SessionForm.vue b/src/components/SessionForm.vue index 65c5491..25309f5 100644 --- a/src/components/SessionForm.vue +++ b/src/components/SessionForm.vue @@ -2,6 +2,12 @@

Submit a Session

+
+
    +
  • {{ message }}
  • +
+
+
  • {{ error.detail }}
  • @@ -36,7 +42,8 @@ export default { field_session_status: 'accepted', field_session_type: 'full', title: '' - } + }, + messages: [] } }, @@ -68,7 +75,10 @@ export default { 'Content-Type': 'application/vnd.api+json' } }) - .then(response => { + .then(({ data }) => { + const title = data.data.attributes.title + this.messages.push(`Session ${title} has been created.`) + this.form.body = '' this.form.title = '' })