Initial upload of BB-Apartment 2026 website.
Adds the complete Next.js website including i18n routing, house and apartment pages, Beds24 v2 integration for live availability/pricing, Stripe checkout, contact forms, Docker setup and deployment docs. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
232770afe7
commit
2b24334bfa
@@ -0,0 +1,38 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { getRoomInfo } from "@/src/lib/beds24";
|
||||
import { allApartments } from "@/src/config/apartments";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const rooms = await Promise.all(
|
||||
allApartments.map(async (apartment) => {
|
||||
const info = await getRoomInfo(
|
||||
apartment.houseId,
|
||||
apartment.beds24PropertyId,
|
||||
apartment.beds24RoomId
|
||||
);
|
||||
return {
|
||||
slug: apartment.slug,
|
||||
beds24RoomId: apartment.beds24RoomId,
|
||||
beds24PropertyId: apartment.beds24PropertyId,
|
||||
name: apartment.name,
|
||||
nameEn: apartment.nameEn,
|
||||
beds24Name: info.name,
|
||||
maxGuests: info.maxGuests,
|
||||
minStay: info.minStay,
|
||||
currency: info.currency,
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
return NextResponse.json({ rooms });
|
||||
} catch (error) {
|
||||
console.error("Rooms API error:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to fetch rooms" },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user