fixes to new message
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Xeovalyte 2022-11-08 15:29:20 +01:00
parent eb08f5cb46
commit c2ef9797f8

View File

@ -16,7 +16,7 @@
</template>
<script setup>
import { addDoc, collection, serverTimestamp } from 'firebase/firestore'
import { addDoc, collection, serverTimestamp, Timestamp } from 'firebase/firestore'
import { useToast } from 'vue-toastification'
definePageMeta({
@ -38,7 +38,6 @@ const form = ref({
const sendNews = async () => {
disableButtons.value = true
try {
const idToken = await auth.value.currentUser.getIdToken(true)
console.log(idToken)
@ -61,13 +60,12 @@ const sendNews = async () => {
});
if (news.value) {
news.value.push({
news.value.unshift({
title: form.value.title,
description: form.value.description,
date: Date.now()
date: Timestamp.now()
})
}
toast.success('Bericht is verstuurd')
navigateTo('/news')