fix(client): Cannot read announcement

Fix #6609
This commit is contained in:
syuilo 2020-08-01 10:02:03 +09:00
parent 7374905c28
commit 9008664606

View file

@ -11,7 +11,7 @@
<img v-if="announcement.imageUrl" :src="announcement.imageUrl"/> <img v-if="announcement.imageUrl" :src="announcement.imageUrl"/>
</div> </div>
<div class="_footer" v-if="$store.getters.isSignedIn && !announcement.isRead"> <div class="_footer" v-if="$store.getters.isSignedIn && !announcement.isRead">
<mk-button @click="read(announcement)" primary><fa :icon="faCheck"/> {{ $t('gotIt') }}</mk-button> <mk-button @click="read(items, announcement, i)" primary><fa :icon="faCheck"/> {{ $t('gotIt') }}</mk-button>
</div> </div>
</section> </section>
</mk-pagination> </mk-pagination>
@ -47,8 +47,13 @@ export default Vue.extend({
}, },
methods: { methods: {
read(announcement) { // TODO:
announcement.isRead = true; read(items, announcement, i) {
console.log(this);
Vue.set(items, i, {
...announcement,
isRead: true,
});
this.$root.api('i/read-announcement', { announcementId: announcement.id }); this.$root.api('i/read-announcement', { announcementId: announcement.id });
}, },
} }