This commit is contained in:
2026-03-11 17:56:17 +03:00
parent 24c935df5f
commit 5a188b80e3
32 changed files with 225 additions and 828 deletions

View File

@@ -15,7 +15,7 @@ export const useAuthStore = defineStore('auth', () => {
},
body: JSON.stringify({ email: email }),
}
const res = await fetch('http://localhost:5173/login', options)
const res = await fetch('http://localhost:5173/api/login', options)
if (res.ok) {
const data: { accessToken: string; refreshToken: string } = await res.json()

View File

@@ -1,12 +1,14 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { User } from '@/stores/users.ts'
import type { Message } from '@/stores/messages.ts'
export interface Chat {
id: string
type_id: number
typeId: number
name: string
users: User[]
message?: Message
}
export const useChatsStore = defineStore('chats', () => {

View File

@@ -3,9 +3,9 @@ import { ref } from 'vue'
export interface Message {
id: number
text: string
user_id: number
created_at: string
message: string
userId: number
createdAt: string
}
export const useMessagesStore = defineStore('messages', () => {