From 56e6d86f882a154f233616f79172391e9d097fcd Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Thu, 17 Mar 2022 15:45:45 -0400 Subject: [PATCH] Allow posting announcements with other metadata --- .../announcements_page/announcements_page.js | 14 ++++++++-- .../announcements_page/announcements_page.vue | 26 +++++++++++++++++++ src/services/api/api.service.js | 4 +-- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/components/announcements_page/announcements_page.js b/src/components/announcements_page/announcements_page.js index ec03836106..3075953355 100644 --- a/src/components/announcements_page/announcements_page.js +++ b/src/components/announcements_page/announcements_page.js @@ -1,14 +1,19 @@ import { mapState } from 'vuex' import Announcement from '../announcement/announcement.vue' +import Checkbox from '../checkbox/checkbox.vue' const AnnouncementsPage = { components: { - Announcement + Announcement, + Checkbox }, data () { return { newAnnouncement: { - content: '' + content: '', + startsAt: undefined, + endsAt: undefined, + allDay: false }, posting: false, error: undefined @@ -29,6 +34,11 @@ const AnnouncementsPage = { postAnnouncement () { this.posting = true this.$store.dispatch('postAnnouncement', this.newAnnouncement) + .then(() => { + this.newAnnouncement.content = '' + this.startsAt = undefined + this.endsAt = undefined + }) .catch(error => { this.error = error.error }) diff --git a/src/components/announcements_page/announcements_page.vue b/src/components/announcements_page/announcements_page.vue index 1b3bd578bd..e81edee12b 100644 --- a/src/components/announcements_page/announcements_page.vue +++ b/src/components/announcements_page/announcements_page.vue @@ -23,6 +23,29 @@ :placeholder="$t('announcements.post_placeholder')" :disabled="posting" /> + + + + + + + + + + + +