You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
436 B
21 lines
436 B
4 years ago
|
import { NextApiRequest, NextApiResponse } from 'next';
|
||
|
|
||
|
import getAllAnvil from './getAllAnvil';
|
||
|
|
||
|
async function handleAPIGetAllAnvil(
|
||
|
request: NextApiRequest,
|
||
|
response: NextApiResponse,
|
||
|
): Promise<void> {
|
||
|
const { anvilList, error }: GetAllAnvilResponse = await getAllAnvil();
|
||
|
|
||
|
if (error) {
|
||
|
response.status(503);
|
||
|
} else {
|
||
|
response.status(200);
|
||
|
}
|
||
|
|
||
|
response.send(anvilList);
|
||
|
}
|
||
|
|
||
|
export default handleAPIGetAllAnvil;
|