Public Access
mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-11 18:37:36 -04:00
Frontend is working without errors.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
"""Adding title to bookings.
|
||||
|
||||
Revision ID: 0005_adding_title_to_bookings
|
||||
Revises: 0004_add_start_end_check_constraint
|
||||
Create Date: 2025-08-28 09:13:48.549322
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence
|
||||
from typing import Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "0005"
|
||||
down_revision: Union[str, Sequence[str], None] = "0004"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column("bookings", sa.Column("title", sa.String(), nullable=True))
|
||||
op.drop_constraint(op.f("uq_invitees_booking_user"), "invitees", type_="unique")
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_unique_constraint(
|
||||
op.f("uq_invitees_booking_user"),
|
||||
"invitees",
|
||||
["booking_id", "user_email"],
|
||||
postgresql_nulls_not_distinct=False,
|
||||
)
|
||||
op.drop_column("bookings", "title")
|
||||
# ### end Alembic commands ###
|
||||
@@ -45,17 +45,19 @@ const LandingPage: FC = () => {
|
||||
axios.get("/rooms/").then((res) => res.data as ConferenceRoom[]),
|
||||
});
|
||||
|
||||
// Fetch today's bookings
|
||||
// Fetch today's bookings for the first room (if any)
|
||||
const firstRoomId = rooms.length > 0 ? rooms[0].id : undefined;
|
||||
const {
|
||||
data: bookings = [],
|
||||
isLoading: bookingsLoading,
|
||||
error: bookingsError,
|
||||
refetch: refetchBookings,
|
||||
} = useQuery({
|
||||
queryKey: ["bookings", today],
|
||||
queryKey: ["bookings", today, firstRoomId],
|
||||
enabled: !!firstRoomId,
|
||||
queryFn: () =>
|
||||
axios
|
||||
.get(`/bookings/room/?date=${today}`)
|
||||
.get(`/bookings/room/${firstRoomId}?date=${today}`)
|
||||
.then((res) => res.data as Booking[]),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user