fixes to new message
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
eb08f5cb46
commit
c2ef9797f8
@ -16,7 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { addDoc, collection, serverTimestamp } from 'firebase/firestore'
|
import { addDoc, collection, serverTimestamp, Timestamp } from 'firebase/firestore'
|
||||||
import { useToast } from 'vue-toastification'
|
import { useToast } from 'vue-toastification'
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
@ -38,7 +38,6 @@ const form = ref({
|
|||||||
const sendNews = async () => {
|
const sendNews = async () => {
|
||||||
disableButtons.value = true
|
disableButtons.value = true
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const idToken = await auth.value.currentUser.getIdToken(true)
|
const idToken = await auth.value.currentUser.getIdToken(true)
|
||||||
console.log(idToken)
|
console.log(idToken)
|
||||||
@ -61,13 +60,12 @@ const sendNews = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (news.value) {
|
if (news.value) {
|
||||||
news.value.push({
|
news.value.unshift({
|
||||||
title: form.value.title,
|
title: form.value.title,
|
||||||
description: form.value.description,
|
description: form.value.description,
|
||||||
date: Date.now()
|
date: Timestamp.now()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
toast.success('Bericht is verstuurd')
|
toast.success('Bericht is verstuurd')
|
||||||
|
|
||||||
navigateTo('/news')
|
navigateTo('/news')
|
||||||
|
Loading…
Reference in New Issue
Block a user