import { NextResponse } from 'next/server'; import Property from '../../models/property'; /** * This route provides an endpoint for a client side fetch request to call * the `findAll()` method on the Property Model. It should be imported into a theme * at `app/api/properties/route.ts` and called inside the exported * GET function. * * The GET function in the theme takes in the request as an argument which should * in turn be passed to this function as an argument. * * To give flexibility in what fields can be requested from each property, fields can be * added or removed from the property serializer in the theme. * * @example * ```tsx * import '../../../api'; * * import routes from '../../../routes'; * * export async function GET(request: Request) { * return routes.properties.index(request); * } * ``` * * The endpoint can then be called at `/api/properties` with any search params * that are required being included as a `params` query paramter. The query parameter * should be a stringified object of all the search params. * * @example * ```tsx * const params = { * search, * county, * location, * page, * pageSize, * postcode, * }; * * const propertiesResponse = await fetch(`/api/properties?params=${JSON.stringify(params)}`); * ``` */ export default function index(request: Request): Promise | NextResponse<{ results: never[] | Property[]; pagination: import("../../models/helpers/pagination").default | null; errors: null; }>>; //# sourceMappingURL=properties-index.d.ts.map