MMMMMMMMMMMMMMMM types

This commit is contained in:
Zoe
2023-01-10 21:21:09 -06:00
parent 880d1bf375
commit cd76dfc147
21 changed files with 147 additions and 82 deletions

View File

@@ -5,8 +5,9 @@
</form>
</template>
<script>
<script lang="ts">
import { useGlobalStore } from '~/stores/store'
import { IChannel } from '~/types'
definePageMeta({
middleware: 'auth'
@@ -20,7 +21,7 @@ export default {
},
methods: {
async startDM() {
const { server } = await $fetch('/api/channels/createDM', { method: 'post', body: { partnerId: this.userId } })
const server: IChannel = await $fetch('/api/channels/createDM', { method: 'post', body: { partnerId: this.userId } })
useGlobalStore().addDM(server)
useRouter().push({ path: '/channel/@me/' + server.id })