added room invite button in rooms that should have it
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user