12 lines
362 B
TypeScript
12 lines
362 B
TypeScript
import type { NextApiRequest, NextApiResponse } from "next";
|
|
import config from "@/config";
|
|
|
|
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
if (req.method === "POST") {
|
|
// update config
|
|
config.begin = req.body.begin ?? config.begin;
|
|
config.limit = req.body.limit ?? config.limit;
|
|
}
|
|
res.status(200).json(config);
|
|
}
|