16 lines
385 B
TypeScript
16 lines
385 B
TypeScript
import type { NextApiRequest, NextApiResponse } from "next";
|
|
import {store, html} from "@/store";
|
|
|
|
export default function handler(
|
|
req: NextApiRequest,
|
|
res: NextApiResponse<Record<string, string>>,
|
|
) {
|
|
if (req.method === 'POST') {
|
|
// update store
|
|
console.log('admin', req.body)
|
|
const json = req.body
|
|
store.update(json)
|
|
}
|
|
res.status(200).json(store.get());
|
|
}
|