refactor: simplify conditional check for class response before fetching rooms
This commit is contained in:
parent
e6d8a9ae9e
commit
c45579221b
@ -48,7 +48,7 @@ const HomePage = () => {
|
||||
useEffect(() => {
|
||||
axiosInstance.get<{ id: string, name: string, createdAt: string }[]>("/@me/class")
|
||||
.then((classResponse) => {
|
||||
classResponse.data.length > 0 &&
|
||||
if (classResponse.data.length)
|
||||
axiosInstance.get<Room[]>(`/@me/class/${classResponse.data[0].id}/rooms`)
|
||||
.then(classes => {
|
||||
// Filter rooms by date, get future, actual and past rooms
|
||||
|
Loading…
Reference in New Issue
Block a user