Redirect to /login on order submit

This commit is contained in:
ekzyis 2023-11-29 08:51:17 +01:00
parent 0ae9f671d4
commit 6ca06e5372
2 changed files with 6 additions and 0 deletions

View File

@ -21,9 +21,11 @@
</template>
<script setup>
import { useSession } from '@/stores/session'
import { ref, computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const session = useSession()
const router = useRouter()
const route = useRoute()
const marketId = route.params.id
@ -77,6 +79,7 @@ const shareId = computed(() => {
})
const submitForm = async () => {
if (!session.isAuthenticated) return router.push('/login')
// TODO validate form
const url = window.origin + '/api/order'
const body = JSON.stringify({

View File

@ -21,9 +21,11 @@
</template>
<script setup>
import { useSession } from '@/stores/session'
import { ref, computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const session = useSession()
const router = useRouter()
const route = useRoute()
const marketId = route.params.id
@ -68,6 +70,7 @@ const userShares = computed(() => {
})
const submitForm = async () => {
if (!session.isAuthenticated) return router.push('/login')
// TODO validate form
const url = window.origin + '/api/order'
const body = JSON.stringify({