Change name for the announcement being edited to editedAnnouncement
This commit is contained in:
parent
eac0008002
commit
5f633bbfa3
@ -9,7 +9,7 @@ const Announcement = {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
editing: false,
|
editing: false,
|
||||||
newAnnouncement: {
|
editedAnnouncement: {
|
||||||
content: '',
|
content: '',
|
||||||
startsAt: undefined,
|
startsAt: undefined,
|
||||||
endsAt: undefined,
|
endsAt: undefined,
|
||||||
@ -65,16 +65,16 @@ const Announcement = {
|
|||||||
return this.announcement['all_day'] ? d.toLocaleDateString(locale) : d.toLocaleString(locale)
|
return this.announcement['all_day'] ? d.toLocaleDateString(locale) : d.toLocaleString(locale)
|
||||||
},
|
},
|
||||||
enterEditMode () {
|
enterEditMode () {
|
||||||
this.newAnnouncement.content = this.announcement.pleroma['raw_content']
|
this.editedAnnouncement.content = this.announcement.pleroma['raw_content']
|
||||||
this.newAnnouncement.startsAt = this.announcement['starts_at']
|
this.editedAnnouncement.startsAt = this.announcement['starts_at']
|
||||||
this.newAnnouncement.endsAt = this.announcement['ends_at']
|
this.editedAnnouncement.endsAt = this.announcement['ends_at']
|
||||||
this.newAnnouncement.allDay = this.announcement['all_day']
|
this.editedAnnouncement.allDay = this.announcement['all_day']
|
||||||
this.editing = true
|
this.editing = true
|
||||||
},
|
},
|
||||||
submitEdit () {
|
submitEdit () {
|
||||||
this.$store.dispatch('editAnnouncement', {
|
this.$store.dispatch('editAnnouncement', {
|
||||||
id: this.announcement.id,
|
id: this.announcement.id,
|
||||||
...this.newAnnouncement
|
...this.editedAnnouncement
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.editing = false
|
this.editing = false
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
/>
|
/>
|
||||||
<announcement-editor
|
<announcement-editor
|
||||||
v-else
|
v-else
|
||||||
:announcement="newAnnouncement"
|
:announcement="editedAnnouncement"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
Loading…
Reference in New Issue
Block a user