generated from avior/template-web-astro
22 lines
451 B
TypeScript
22 lines
451 B
TypeScript
import type { APIRoute } from 'astro'
|
|
import ResponseBuilder from 'libs/ResponseBuilder'
|
|
|
|
interface Project {
|
|
name: string
|
|
id: string
|
|
}
|
|
|
|
export const GET: APIRoute = ({ url }) => {
|
|
const nameFilter = url.searchParams.get('name')
|
|
return new ResponseBuilder().body(([
|
|
{
|
|
name: 'Holisané',
|
|
id: 'HOLIS'
|
|
},
|
|
{
|
|
name: 'Aptatio',
|
|
id: 'APTA'
|
|
}
|
|
] as Array<Project>).filter((it) => !nameFilter || it.name.includes(nameFilter))).build()
|
|
}
|