stream day 2
This commit is contained in:
26
pages/channel/@me/index.vue
Normal file
26
pages/channel/@me/index.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<form @submit.prevent="startDM">
|
||||
<input v-model="userId" />
|
||||
<input type="submit" />
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { useServerStore } from '~/stores/servers'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userId: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async startDM() {
|
||||
const { server } = await $fetch('/api/channel/createDM', { method: 'post', body: { partnerId: this.userId } })
|
||||
|
||||
useServerStore().addDM(server)
|
||||
useRouter().push({ path: '/channel/@me/' + server.id })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user