This commit is contained in:
Kar
2023-05-19 02:08:06 +05:30
parent 27657679d7
commit 4ea8d4d839
22 changed files with 404 additions and 198 deletions

View File

@@ -3,7 +3,7 @@ export default function handler(req, res) {
console.log(req.body)
// Open a new database connection
let uname, status, type, start_month, start_date, end_date, klas, lang, phone, pass, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school="";
let uname, status, type, start_month, start_date, end_date, klas, lang, phone, pass, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school="";
if(req.body.uname) uname =req.body.uname;
if(req.body.status) status =req.body.status;
@@ -15,7 +15,7 @@ export default function handler(req, res) {
if(req.body.lang) lang =req.body.lang;
if(req.body.phone) phone =req.body.phone;
if(req.body.pass) pass =req.body.pass;
if(req.body.anual) anual =req.body.anual;
if(req.body.annual) annual =req.body.annual;
if(req.body.early_start_programme) early_start_programme =req.body.early_start_programme;
if(req.body.toddlers) toddlers =req.body.toddlers;
if(req.body.interakto) interakto =req.body.interakto;
@@ -27,7 +27,7 @@ export default function handler(req, res) {
if(req.body.school) school =req.body.school;
const db = new sqlite3.Database('data/appUser.db');
console.log(req.body.userId)
db.run(`UPDATE user SET uname = ?, status = ?, type = ?, start_month = ?, start_date = ?, end_date = ?, klas = ?, lang = ?, phone = ?, anual = ?, early_start_programme = ?, toddlers = ?, interakto = ?, email = ?, country = ?, state = ?, city = ?, address = ?, school = ? WHERE id = ? `, [ uname, status, type, start_month, start_date, end_date, klas, lang, phone, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school, req.body.userId],
db.run(`UPDATE user SET uname = ?, status = ?, type = ?, start_month = ?, start_date = ?, end_date = ?, klas = ?, lang = ?, phone = ?, annual = ?, early_start_programme = ?, toddlers = ?, interakto = ?, email = ?, country = ?, state = ?, city = ?, address = ?, school = ? WHERE id = ? `, [ uname, status, type, start_month, start_date, end_date, klas, lang, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school, req.body.userId],
function(err) {
if (err) {
res.status(400).json({ msg: 'Err400D' });