added room invite button in rooms that should have it

This commit is contained in:
2025-12-31 15:44:45 +01:00
parent e7a575ae03
commit e3f9b3b8e9
10 changed files with 220 additions and 24 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ export async function apiFetch<T>(
},
})
if (res.status === 401) {
if (res.status === 401 && auth.token) {
await clearAuthData()
router.push('/login')
throw new Error("Session expired")
+4
View File
@@ -5,6 +5,10 @@ export function fetchRooms() {
return apiFetch<Room[]>(`/rooms`)
}
export function fetchRoomInfo(uuid: string) {
return apiFetch<Room>(`/rooms/${uuid}`)
}
export function createRoom(name: string, global: boolean) {
return apiFetch<Room>('/rooms', {
method: 'POST',