-
-
+
+
diff --git a/src/pages/api/addSchool.js b/src/pages/api/addSchool.js
new file mode 100644
index 0000000..2f74f09
--- /dev/null
+++ b/src/pages/api/addSchool.js
@@ -0,0 +1,37 @@
+export default function handler(req, res) {
+ const sqlite3 = require('sqlite3').verbose();
+
+ // console.log(req.body)
+ // Open a new database connection
+ let sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry = "";
+
+ if(req.body.sname) sname =req.body.sname;
+ // if(req.body.status) status =req.body.status;
+ if(req.body.status) status ="published";
+ if(req.body.phone) phone =req.body.phone;
+ 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;
+ if(req.body.email) email =req.body.email;
+ if(req.body.country) country =req.body.country;
+ if(req.body.state) state =req.body.state;
+ if(req.body.city) city =req.body.city;
+ if(req.body.address) address =req.body.address;
+ if(req.body.agg_expiry) agg_expiry =req.body.agg_expiry;
+ if(req.body.usage_expiry) usage_expiry =req.body.usage_expiry;
+
+ const db = new sqlite3.Database('data/appUser.db');
+ db.run(`INSERT INTO school (sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [ sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry],
+ function(err) {
+ if (err) {
+ return console.log(err.message);
+ }
+ }
+ );
+ db.close();
+
+
+ res.status(200).json({ msg: 'ok' });
+ }
+
\ No newline at end of file
diff --git a/src/pages/api/addUsers.js b/src/pages/api/addUsers.js
index 372a80f..81807b0 100644
--- a/src/pages/api/addUsers.js
+++ b/src/pages/api/addUsers.js
@@ -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, plan, 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, plan, 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,10 +15,9 @@ export default function handler(req, res) {
if(req.body.plan) plan =req.body.plan;
if(req.body.klas) klas =req.body.klas;
if(req.body.lang) lang =req.body.lang;
- 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;
@@ -29,7 +28,7 @@ export default function handler(req, res) {
if(req.body.address) address =req.body.address;
if(req.body.school) school =req.body.school;
const db = new sqlite3.Database('data/appUser.db');
- db.run(`INSERT INTO user (uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [ uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school],
+ db.run(`INSERT INTO user (uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [ uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school],
function(err) {
if (err) {
return console.log(err.message);
diff --git a/src/pages/api/editSchool.js b/src/pages/api/editSchool.js
new file mode 100644
index 0000000..d29a2c1
--- /dev/null
+++ b/src/pages/api/editSchool.js
@@ -0,0 +1,41 @@
+export default function handler(req, res) {
+ const sqlite3 = require('sqlite3').verbose();
+
+ console.log(req.body)
+
+ // Open a new database connection
+ let sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry = "";
+
+ if(req.body.sname) sname =req.body.sname;
+ if(req.body.status) status =req.body.status;
+ // if(req.body.status) status ="published";
+ if(req.body.phone) phone =req.body.phone;
+ 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;
+ if(req.body.email) email =req.body.email;
+ if(req.body.country) country =req.body.country;
+ if(req.body.state) state =req.body.state;
+ if(req.body.city) city =req.body.city;
+ if(req.body.address) address =req.body.address;
+ if(req.body.agg_expiry) agg_expiry =req.body.agg_expiry;
+ if(req.body.usage_expiry) usage_expiry =req.body.usage_expiry;
+
+ const db = new sqlite3.Database('data/appUser.db');
+ console.log(req.body.userId)
+ db.run(`UPDATE school SET sname = ?, status = ?, phone = ?, annual = ?, early_start_programme = ?, toddlers = ?, interakto = ?, email = ?, country = ?, state = ?, city = ?, address = ?, agg_expiry = ?, usage_expiry = ? WHERE id = ? `, [ sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry, req.body.schoolId],
+ function(err) {
+ if (err) {
+ res.status(400).json({ msg: 'Err400D' });
+ return console.log(err.message);
+ }
+ res.status(200).json({ msg: 'ok' });
+ }
+ );
+ db.close();
+
+
+
+ }
+
\ No newline at end of file
diff --git a/src/pages/api/editUser.js b/src/pages/api/editUser.js
index f961a47..176e89a 100644
--- a/src/pages/api/editUser.js
+++ b/src/pages/api/editUser.js
@@ -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' });
diff --git a/src/pages/api/getSchoolDetails.js b/src/pages/api/getSchoolDetails.js
new file mode 100644
index 0000000..dee0256
--- /dev/null
+++ b/src/pages/api/getSchoolDetails.js
@@ -0,0 +1,41 @@
+import csv from 'csv-parser';
+import fs from 'fs';
+import sqlite3 from 'sqlite3';
+
+export default function handler(req,res) {
+
+
+ const DB_NAME = 'data/appUser.db';
+ const TABLE_NAME = 'school';
+
+ const db = new sqlite3.Database(DB_NAME);
+
+ const query = `SELECT * FROM ${TABLE_NAME}`;
+
+ function getAllRows(tableName) {
+ return new Promise((resolve, reject) => {
+ const sql = `SELECT * FROM ${tableName} WHERE id = ?`;
+ db.all(sql, [req.query.school], (err, rows) => {
+ if (err) {
+ reject(err);
+ return;
+ }
+ const data = rows;
+ resolve(data);
+ });
+ });
+ };
+ async function doSomething() {
+ try {
+ const returnData = await getAllRows('school');
+ res.setHeader('Content-Type', 'application/json')
+ res.status(200).json(returnData)
+ // console.log(data);
+ } catch (err) {
+ console.error(err);
+ }
+ }
+
+ doSomething();
+}
+
diff --git a/src/pages/api/listSchlools.js b/src/pages/api/listSchlools.js
new file mode 100644
index 0000000..18588a2
--- /dev/null
+++ b/src/pages/api/listSchlools.js
@@ -0,0 +1,73 @@
+import csv from 'csv-parser';
+import fs from 'fs';
+import sqlite3 from 'sqlite3';
+
+export default function handler(req,res) {
+
+console.log(req.body.school)
+// const {
+// query: { name, keyword },
+// method,
+// } = req;
+// console.log(name, keyword, method);
+
+ const DB_NAME = 'data/appUser.db';
+ const TABLE_NAME = 'school';
+
+ // Open a connection to the SQLite database
+ const db = new sqlite3.Database(DB_NAME);
+
+ const query = `SELECT * FROM ${TABLE_NAME}`;
+
+ function getAllRows(tableName) {
+ return new Promise((resolve, reject) => {
+ const sql = `SELECT * FROM ${tableName}`;
+ db.all(sql, [], (err, rows) => {
+ if (err) {
+ reject(err);
+ return;
+ }
+ const data = rows;
+ resolve(data);
+ });
+ });
+ };
+ async function doSomething() {
+ try {
+ const returnData = await getAllRows(TABLE_NAME);
+ res.setHeader('Content-Type', 'application/json')
+ res.status(200).json(returnData)
+ // console.log(data);
+ } catch (err) {
+ console.error(err);
+ }
+ }
+
+ doSomething();
+// const returnData = getAllRows('user');
+// console.log(getAllRows('user'));
+// const returnData= db.run('SELECT * FROM user');
+
+// fs.createReadStream('data/user.csv')
+// .pipe(csv())
+// .on('data', (data) => {
+// const values = Object.values(data);
+// const placeholders = values.map(() => '?').join(',');
+// const sql = `INSERT INTO ${TABLE_NAME} (${Object.keys(data).join(',')}) VALUES (${placeholders})`;
+// db.run(sql, values, (err) => {
+// if (err) {
+// console.error(err);
+// }
+// });
+// })
+// .on('end', () => {
+// console.log(`Data inserted successfully into table ${TABLE_NAME}`);
+
+// // Close the database connection
+// db.close();
+// });
+
+
+
+}
+
diff --git a/src/pages/api/login.js b/src/pages/api/login.js
index a1c7215..9c5f6bc 100644
--- a/src/pages/api/login.js
+++ b/src/pages/api/login.js
@@ -1,7 +1,7 @@
export default function handler(req, res) {
- // const sqlite3 = require('sqlite3').verbose();
-
- console.log(req.body)
+ // const sqlite3 = require('sqlite3').verbose();
+
+ // console.log(req.body)
const sqlite3 = require('sqlite3');
const argon2 = require('argon2');
const jwt = require('jsonwebtoken');
@@ -10,43 +10,63 @@ const jwt = require('jsonwebtoken');
const db = new sqlite3.Database('data/appUser.db');
// Fetch the user record
-const username = 'example_user';
-const sql = 'SELECT pass FROM user_table WHERE username = ?';
+const username = req.body.email;
+// console.log(username)
+const sql = 'SELECT * FROM user WHERE email = ?';
db.get(sql, [username], async (err, userRecord) => {
- if (err) {
- console.error(err);
- return;
- }
+if (err) {
+ console.error(err);
+ return;
+}
- if (userRecord) {
- const storedHash = userRecord.password_hash;
- const providedPassword = 'example_password';
+if (userRecord) {
+ const storedHash = userRecord.pass;
+ console.log(storedHash)
+ const providedPassword = req.body.password;
- try {
- // Verify the provided password with the stored hash
- const isPasswordValid = await argon2.verify(storedHash, providedPassword);
+ try {
+ // Verify the provided password with the stored hash
+ const isPasswordValid = await argon2.verify(storedHash, providedPassword);
- if (isPasswordValid) {
- // Passwords match, generate JWT token
- const secretKey = process.env.JWT_SEC;
- const tokenPayload = { username: username };
- const jwtToken = jwt.sign(tokenPayload, secretKey, { algorithm: 'HS256' });
+ if (isPasswordValid) {
+ // Passwords match, generate JWT token
+ const secretKey = process.env.TOKEN_HEADER_KEY;
+ const tokenPayload = {
+ email:userRecord.email,
+ role: userRecord.type,
+ iat: Math.floor(Date.now() / 1000),
+ exp: Math.floor(Date.now() / 1000) + 3600*24*7,
+
+ };
+ const jwtToken = jwt.sign(tokenPayload, secretKey, { algorithm: 'HS256' });
+ const jwtTokenData ={
+ data:{
+ access_token:jwtToken,
+ role: userRecord.type,
+ email: userRecord.email,
+ expires: 3600*24*7,
+
+ }
+ };
- // Return the JWT token
- console.log(jwtToken);
- } else {
- console.log('Invalid password');
- }
- } catch (err) {
- console.error(err);
+ // Return the JWT token
+ res.status(200).json(jwtTokenData);
+ console.log(jwtToken);
+ } else {
+ console.log('Invalid password');
+ res.status(400).json({err:'400P'});
}
- } else {
- console.log('User not found');
+ } catch (err) {
+ console.error(err);
}
+} else {
+ res.status(400).json({err:'400U'});
+ console.log('User not found');
+}
- // Close the database connection
- db.close();
+// Close the database connection
+db.close();
});
-res.status(200).json({ name: 'John Doe' });
+// res.status(200).json({ name: 'John Doe' });
}
\ No newline at end of file
diff --git a/src/pages/edit-school copy.jsx b/src/pages/edit-school copy.jsx
index fb04449..2b2c4d2 100644
--- a/src/pages/edit-school copy.jsx
+++ b/src/pages/edit-school copy.jsx
@@ -33,7 +33,7 @@ export default function addSchoolForm() {
country: event.target.country.value,
state: event.target.state.value,
cities: event.target.cities.value,
- anual: event.target.anual.value,
+ annual: event.target.annual.value,
toddlers: event.target.toddlers.value,
early_start_programme: event.target.early_start_programme.value,
interakto: event.target.interakto.value,
@@ -100,8 +100,8 @@ export default function addSchoolForm() {
setSchool(e.target.value)} name="school_contact_number" />
-
- setSchool(e.target.value)} />
+
+ setSchool(e.target.value)} />
diff --git a/src/pages/edit-school.jsx b/src/pages/edit-school.jsx
index d795573..48cbc50 100644
--- a/src/pages/edit-school.jsx
+++ b/src/pages/edit-school.jsx
@@ -6,62 +6,43 @@ import { useRouter } from 'next/router'
export default function editSchool() {
const router = useRouter();
- // const updateSchoolData = async (event) => {
- // const body = new FormData();
- // body.append("file", agreement.files[0]);
- // body.append("fName", `${router.query.school}.pdf`);
- // const response = await fetch("/api/updateUserDetails", {
- // method: "POST",
- // body
- // });
- // };
-
const [school, setSchool] = useState({});
useEffect(()=>{
- // console.log(router.query);
- // if(router.query.school<1) {
- // const { sid } = router.query;
- // setSchool(sid)
- if(router.query.school && router.query.school>1 ){
- fetch(`https://management.beanstalkedu.com/items/school?school=${router.query.school}`)
+ if(router.query.school && router.query.school>0 ){
+ console.log(router.query);
+ fetch(`/api/getSchoolDetails?school=${router.query.school}`)
.then(res => res.json())
.then(data => {
- // console.log(data);
- setSchool(data.data[0])
- // console.log(data.data)
-
+ console.log(data);
+ setSchool(data[0])
+ // console.log(school)
})
}
- // console.log(data.data)
-
}, [router.query.school]);
const updateSchoolData = async (event) => {
event.preventDefault()
const data = {
- // schoolId: router.query.school,
- name: event.target.name.value,
- // status: event.target.status.value,
- // uname: event.target.uname.value,
- // country: event.target.country.value,
- // state: event.target.state.value,
- // city: event.target.city.value,
- // address: event.target.address.value,
- // start_date: event.target.start_date.value,
- // end_date: event.target.end_date.value,
- // school: event.target.school.value,
- // anual: event.target.anual.value,
- // toddlers: event.target.toddlers.value,
- // early_start_programme: event.target.early_start_programme.value,
- // email: event.target.email.value,
- // phone: event.target.phone.value,
- // klas: event.target.klas.value
+ schoolId: router.query.school,
+ sname: event.target.sname.value,
+ status: event.target.status.value,
+ country: event.target.country.value,
+ state: event.target.state.value,
+ city: event.target.city.value,
+ annual: event.target.annual.value,
+ toddlers: event.target.toddlers.value,
+ early_start_programme: event.target.early_start_programme.value,
+ interakto: event.target.interakto.value,
+ agg_expiry: event.target.agg_expiry.value,
+ usage_expiry: event.target.usage_expiry.value,
+ phone: event.target.phone.value,
+ email: event.target.email.value,
}
const JSONdata = JSON.stringify(data)
- // console.log(data)
- const endpoint = 'https://management.beanstalkedu.com/items/school'
+ console.log(data)
+ const endpoint = '/api/editSchool'
const options = {
method: 'POST',
headers: {
@@ -70,10 +51,11 @@ export default function editSchool() {
body: JSONdata,
}
const response = await fetch(endpoint, options)
+
const result = await response.json()
// alert(`Is this your full name: ${result.data}`)
- alert(`School data updated`)
-
+ alert(`User data updated`)
+
}
return (
@@ -83,65 +65,73 @@ export default function editSchool() {
-
-

-
Update School Information
+
+
Update School Information
+
+
+
+
setSchool(e.target.value)} type="file" name="agreement_documents" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
+
+
+
+
+
+
+
)
}
+
+
diff --git a/src/pages/edit-school2.jsx b/src/pages/edit-school2.jsx
index ef230da..6a53869 100644
--- a/src/pages/edit-school2.jsx
+++ b/src/pages/edit-school2.jsx
@@ -43,7 +43,7 @@ export default function addSchoolForm() {
country: event.target.country.value,
state: event.target.state.value,
cities: event.target.cities.value,
- anual: event.target.anual.value,
+ annual: event.target.annual.value,
toddlers: event.target.toddlers.value,
early_start_programme: event.target.early_start_programme.value,
interakto: event.target.interakto.value,
@@ -110,8 +110,8 @@ export default function addSchoolForm() {
setSchool(e.target.value)} name="school_contact_number" className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
-
- setSchool(e.target.value)} className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
+
+ setSchool(e.target.value)} className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
diff --git a/src/pages/edit-user.jsx b/src/pages/edit-user.jsx
index f763a9c..8beb7fa 100644
--- a/src/pages/edit-user.jsx
+++ b/src/pages/edit-user.jsx
@@ -23,7 +23,7 @@ export default function editUser() {
// if(router.query.school<1) {
// const { sid } = router.query;
// setSchool(sid)
- if(router.query.user && router.query.user>1 ){
+ if(router.query.user && router.query.user>0 ){
fetch(`/api/getUserDetails?user=${router.query.user}`)
.then(res => res.json())
.then(data => {
@@ -49,7 +49,7 @@ export default function editUser() {
start_date: event.target.start_date.value,
end_date: event.target.end_date.value,
school: event.target.school.value,
- anual: event.target.anual.value,
+ annual: event.target.annual.value,
toddlers: event.target.toddlers.value,
early_start_programme: event.target.early_start_programme.value,
interakto: event.target.interakto.value,
@@ -145,8 +145,8 @@ export default function editUser() {
setUser(e.target.value)} type="text" name="klas" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
-
- setUser(e.target.value)} type="text" name="anual" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
+
+ setUser(e.target.value)} type="text" name="annual" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
diff --git a/src/pages/edit-user2.jsx b/src/pages/edit-user2.jsx
index 46d6eba..18a9be3 100644
--- a/src/pages/edit-user2.jsx
+++ b/src/pages/edit-user2.jsx
@@ -121,7 +121,7 @@ export default function addUserForm() {
start_month: event.target.start_month.value,
start_date: event.target.start_date.value,
end_date: event.target.end_date.value,
- anual: event.target.anual.value,
+ annual: event.target.annual.value,
early_start_programme: event.target.early_start_programme.value,
toddlers: event.target.toddlers.value,
interakto: event.target.interakto.value,
@@ -258,8 +258,8 @@ export default function addUserForm() {
{individualValue &&
-
-
-
-
+
+
diff --git a/src/pages/school-list/index.jsx b/src/pages/school-list/index.jsx
index 64cd67c..6fe6eda 100644
--- a/src/pages/school-list/index.jsx
+++ b/src/pages/school-list/index.jsx
@@ -5,11 +5,11 @@ import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })
import NavBar from '../../components/NavBar'
export default function Modal() {
- const [school, setUser] = useState([]);
+ const [school, setSchool] = useState([]);
const fetchData = async () => {
- const response = await fetch("https://management.beanstalkedu.com/items/school?filter[status][_eq]=published");
+ const response = await fetch("/api/listSchlools");
const data = await response.json();
- return setUser(data.data);
+ return setSchool(data);
}
console.log(school)
@@ -33,14 +33,7 @@ const fetchData = async () => {
Add School
*/}
-
-
- List Users Under This School
-
-
- CSV Upload
-
-
+
@@ -48,14 +41,10 @@ const fetchData = async () => {
ID |
- School Name |
- Country |
- Annual |
- S.E.D |
- E.S.P |
- Toddlers |
- Interakto |
+ Name |
+ City |
Status |
+ Expiry |
Edit |
@@ -63,16 +52,14 @@ const fetchData = async () => {
{school.map(data=>
{data.id} |
- {data.name} |
- {data.country} |
- {data.anual} |
- {data.agreement_expiry_date} |
- {data.early_start_programme} |
- {data.toddlers} |
- {data.interakto} |
+ {data.sname} |
+ {data.city} |
{data.status} |
-
- |
+ {data.usage_expiry} |
+
+
+
+ |
)}
diff --git a/src/pages/school-list/slug.jsx b/src/pages/school-list/slug.jsx
index 526067a..ea2b87f 100644
--- a/src/pages/school-list/slug.jsx
+++ b/src/pages/school-list/slug.jsx
@@ -58,7 +58,7 @@ export default function addSchoolForm() {
country: event.target.country.value,
state: event.target.state.value,
cities: event.target.cities.value,
- anual: event.target.anual.value,
+ annual: event.target.annual.value,
toddlers: event.target.toddlers.value,
early_start_programme: event.target.early_start_programme.value,
interakto: event.target.interakto.value,
@@ -150,8 +150,8 @@ export default function addSchoolForm() {
-
-
+
+