Redirect to /login on order submit
This commit is contained in:
parent
0ae9f671d4
commit
6ca06e5372
|
@ -21,9 +21,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { useSession } from '@/stores/session'
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const session = useSession()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const marketId = route.params.id
|
const marketId = route.params.id
|
||||||
|
@ -77,6 +79,7 @@ const shareId = computed(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
|
if (!session.isAuthenticated) return router.push('/login')
|
||||||
// TODO validate form
|
// TODO validate form
|
||||||
const url = window.origin + '/api/order'
|
const url = window.origin + '/api/order'
|
||||||
const body = JSON.stringify({
|
const body = JSON.stringify({
|
||||||
|
|
|
@ -21,9 +21,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { useSession } from '@/stores/session'
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const session = useSession()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const marketId = route.params.id
|
const marketId = route.params.id
|
||||||
|
@ -68,6 +70,7 @@ const userShares = computed(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
|
if (!session.isAuthenticated) return router.push('/login')
|
||||||
// TODO validate form
|
// TODO validate form
|
||||||
const url = window.origin + '/api/order'
|
const url = window.origin + '/api/order'
|
||||||
const body = JSON.stringify({
|
const body = JSON.stringify({
|
||||||
|
|
Loading…
Reference in New Issue