Redirect to /login on order submit
This commit is contained in:
parent
0ae9f671d4
commit
6ca06e5372
|
@ -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({
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue