1
0
forked from PGL/Clyde

fix for new discussions not appearing right away

This commit is contained in:
Debucquoy Anthony 2024-03-25 09:43:45 +01:00
parent 66e7fa24a1
commit 914f6bdf36
Signed by: tonitch
GPG Key ID: A78D6421F083D42E
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@
import { ref, reactive } from 'vue'
import { getDiscussions, currentDiscussion, fetchDiscussion, createDiscussion } from '@/rest/msg.js'
const discussionsList = ref(await getDiscussions());
const discussionsList = reactive(await getDiscussions());
</script>
@ -17,7 +17,7 @@
<div id="msg">
<div id="discList">
<div @click="fetchDiscussion(discussion.id)" class="discItem" v-for="discussion in discussionsList" :key="discussion.id">{{ discussion.name }}</div>
<button id="createDiscussion" @click="createDiscussion('New Discussion'); getDiscussions().then(e => { discussionsList = e; })">+</button>
<button id="createDiscussion" @click="createDiscussion('New Discussion').then( e => discussionsList.push(e) )">+</button>
</div>
<div id="discussion">
<h1 id=msgName >{{currentDiscussion.name}}</h1>

View File

@ -73,7 +73,7 @@ export async function fetchDiscussion(id){
}
export async function createDiscussion(name){
restPost("/discussion", {name: name});
return restPost("/discussion", {name: name});
}