import { NextResponse } from 'next/server'; import Testimonial from '../../models/testimonial'; /** * This route provides an endpoint for a client side fetch request to call * the `findAll()` method on the Testimonial Model. It should be imported into a theme * at `app/api/testimonials/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 article, fields can be * added or removed from the article serializer in the theme. * * @example * ```tsx * import '../../../api'; * * import routes from '../../../routes'; * * export async function GET(request: Request) { * return routes.testimonials.index(request); * } * ``` * * The endpoint can then be called at `/api/testimonials` 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 = { * page, * pageSize, * }; * * const testimonialsResponse = await fetch(`/api/testimonials?params=${JSON.stringify(params)}`); * ``` */ export default function index(request: Request): Promise | NextResponse<{ results: Testimonial[]; pagination: import("../../models/helpers/pagination").default | null; error: null; }>>; //# sourceMappingURL=testimonials-index.d.ts.map