suseendhiran

This commit is contained in:
suseendhiran17 2022-11-28 14:29:55 +05:30
parent 0cf797a2e3
commit 59165504b8
3 changed files with 10 additions and 11 deletions

View File

@ -6,12 +6,10 @@ require('dotenv').config();
let dropdown = []; let dropdown = [];
let column_name; let column_name;
let doc; let doc;
let CREDENTIALS;
const tempData = []; const tempData = [];
exports.Welcome = (req, res) => exports.Welcome = (req, res) =>
{ {
try try
@ -43,7 +41,6 @@ exports.loginPage = async (req, res ) =>
exports.getRow = async (req, res) => exports.getRow = async (req, res) =>
{ {
try try
@ -133,6 +130,7 @@ exports.getRow = async (req, res) =>
}; };
exports.addRow = async (req, res) => exports.addRow = async (req, res) =>
{ {
try try
@ -165,7 +163,6 @@ exports.addRow = async (req, res) =>
exports.updateRow = async (req, res ) => exports.updateRow = async (req, res ) =>
{ {
try try

View File

@ -818,6 +818,11 @@ select , option {
<script> <script>
// console.log(window.location.host);
// console.log(window.location.protocol);
// console.log(window.location.origin);
let oldValue = [];let newValue = [];let pos = []; let oldValue = [];let newValue = [];let pos = [];
// SI dynamic background-color // SI dynamic background-color
@ -885,7 +890,6 @@ $(document).on("click", "#add-new", function(){
// Update g-sheet data // Update g-sheet data
//after change/update click submit button this function will update the data in g-sheet //after change/update click submit button this function will update the data in g-sheet
$(document).on("click", "#up", function(){ $(document).on("click", "#up", function(){
for (let i = 0; i < oldValue.length; i++) { for (let i = 0; i < oldValue.length; i++) {
if (i == 0) { if (i == 0) {
newValue.push($(`#${i}`).val()) newValue.push($(`#${i}`).val())
@ -899,11 +903,10 @@ $(document).on("click", "#up", function(){
pos[0].find(`td:nth-child(${i+1})`).html($(`#${i}`).val()); pos[0].find(`td:nth-child(${i+1})`).html($(`#${i}`).val());
} }
} }
// update data in googlesheet using ajax // update data in googlesheet using ajax
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/api/updateRow", url: ''+ window.location.origin +'/api/updateRow',
data: { Old : oldValue , New : newValue }, data: { Old : oldValue , New : newValue },
success: function(response) { success: function(response) {
if (response.status == 200) { alert("updated") } if (response.status == 200) { alert("updated") }
@ -913,7 +916,7 @@ $(document).on("click", "#up", function(){
// clear arr // clear arr
pos = []; oldValue = []; newValue = []; pos = []; oldValue = []; newValue = [];
}); });
//click edit form icon fetch relevent id data from g-sheet then displayed it to the relevent field in form //click edit form-icon fetch relevent id data from g-sheet then displayed it to the relevent field in the form
$(document).on("click", ".update", function(){ $(document).on("click", ".update", function(){
pos.push($(this).children("tr")); pos.push($(this).children("tr"));
$(this).children("tr").find("td:not(:last-child)").each(function(index){ $(this).children("tr").find("td:not(:last-child)").each(function(index){
@ -922,7 +925,6 @@ $(document).on("click", ".update", function(){
}); });
}); });
// Filter and Search // Filter and Search
$(document).ready(function(){ $(document).ready(function(){
$("#myInput").on("keyup", function() { $("#myInput").on("keyup", function() {

View File

@ -23,7 +23,7 @@ const options = {
definition: { definition: {
openapi: '3.0.0', openapi: '3.0.0',
info: { info: {
title: 'Smc_cet_financials', title: 'google sheet',
version: '1.0.0', version: '1.0.0',
}, },
}, },
@ -59,7 +59,7 @@ require("./app/routes/routes.js")(app);
const PORT_NUMBER = process.env.SERVER_PORT const PORT_NUMBER = process.env.SERVER_PORT
app.listen({ port: PORT_NUMBER }, async () => { app.listen({ port: PORT_NUMBER }, async () => {
console.log('Server up on http://localhost:8080') console.log('Server up on http://localhost:'+ PORT_NUMBER+'')
//await sequelize.authenticate() //await sequelize.authenticate()
}) })