-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
783 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// TODO: define how to show the available filters for this entity: show enums, retrieve from data, smart filtering... | ||
// i.e, location is an available filter but the prop is defined as a string as it is not clear which the available values are. | ||
|
||
import { NextRequest, NextResponse } from 'next/server'; | ||
|
||
import { CaseStudyService } from '@/lib/case-studies.service'; | ||
|
||
import { CASE_STUDIES } from '@/data/case-studies'; | ||
|
||
export async function GET(request: NextRequest) { | ||
const { searchParams } = request.nextUrl; | ||
|
||
const { filters, paginationFilters } = CaseStudyService.extractFilters(searchParams); | ||
const caseStudyService = new CaseStudyService(CASE_STUDIES, filters, paginationFilters); | ||
const result = caseStudyService.searchCaseStudies(); | ||
|
||
return NextResponse.json(result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.