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.
20 lines
784 B
20 lines
784 B
import type { NextApiRequest, NextApiResponse } from 'next'
|
|
import Insert from "../../server/db/insert";
|
|
|
|
const sql = "INSERT INTO members (name_team_coach, coach_telefon_number, trainer_mail, city_team, training_institution_team, team_name, name_first_participant, first_partial_class, name_second_participant, second_class, name_third_party, third_part_class) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
|
type Data = {
|
|
error: string,
|
|
data: string,
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export default function handler(
|
|
req: NextApiRequest,
|
|
res: NextApiResponse<Data>
|
|
) {
|
|
const re = /\s*,\s*/;
|
|
const parm = req.body;
|
|
Insert(sql, parm.split(re), function(data){
|
|
res.status(200).json(data);
|
|
})
|
|
} |