suseendhiran
This commit is contained in:
parent
0cf797a2e3
commit
59165504b8
@ -6,12 +6,10 @@ require('dotenv').config();
|
||||
let dropdown = [];
|
||||
let column_name;
|
||||
let doc;
|
||||
let CREDENTIALS;
|
||||
const tempData = [];
|
||||
|
||||
|
||||
|
||||
|
||||
exports.Welcome = (req, res) =>
|
||||
{
|
||||
try
|
||||
@ -43,7 +41,6 @@ exports.loginPage = async (req, res ) =>
|
||||
|
||||
|
||||
|
||||
|
||||
exports.getRow = async (req, res) =>
|
||||
{
|
||||
try
|
||||
@ -133,6 +130,7 @@ exports.getRow = async (req, res) =>
|
||||
};
|
||||
|
||||
|
||||
|
||||
exports.addRow = async (req, res) =>
|
||||
{
|
||||
try
|
||||
@ -165,7 +163,6 @@ exports.addRow = async (req, res) =>
|
||||
|
||||
|
||||
|
||||
|
||||
exports.updateRow = async (req, res ) =>
|
||||
{
|
||||
try
|
||||
|
||||
@ -818,6 +818,11 @@ select , option {
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// console.log(window.location.host);
|
||||
// console.log(window.location.protocol);
|
||||
// console.log(window.location.origin);
|
||||
|
||||
let oldValue = [];let newValue = [];let pos = [];
|
||||
|
||||
// SI dynamic background-color
|
||||
@ -885,7 +890,6 @@ $(document).on("click", "#add-new", function(){
|
||||
// Update g-sheet data
|
||||
//after change/update click submit button this function will update the data in g-sheet
|
||||
$(document).on("click", "#up", function(){
|
||||
|
||||
for (let i = 0; i < oldValue.length; i++) {
|
||||
if (i == 0) {
|
||||
newValue.push($(`#${i}`).val())
|
||||
@ -899,11 +903,10 @@ $(document).on("click", "#up", function(){
|
||||
pos[0].find(`td:nth-child(${i+1})`).html($(`#${i}`).val());
|
||||
}
|
||||
}
|
||||
|
||||
// update data in googlesheet using ajax
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/api/updateRow",
|
||||
url: ''+ window.location.origin +'/api/updateRow',
|
||||
data: { Old : oldValue , New : newValue },
|
||||
success: function(response) {
|
||||
if (response.status == 200) { alert("updated") }
|
||||
@ -913,7 +916,7 @@ $(document).on("click", "#up", function(){
|
||||
// clear arr
|
||||
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(){
|
||||
pos.push($(this).children("tr"));
|
||||
$(this).children("tr").find("td:not(:last-child)").each(function(index){
|
||||
@ -922,7 +925,6 @@ $(document).on("click", ".update", function(){
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Filter and Search
|
||||
$(document).ready(function(){
|
||||
$("#myInput").on("keyup", function() {
|
||||
|
||||
@ -23,7 +23,7 @@ const options = {
|
||||
definition: {
|
||||
openapi: '3.0.0',
|
||||
info: {
|
||||
title: 'Smc_cet_financials',
|
||||
title: 'google sheet',
|
||||
version: '1.0.0',
|
||||
},
|
||||
},
|
||||
@ -59,7 +59,7 @@ require("./app/routes/routes.js")(app);
|
||||
|
||||
const PORT_NUMBER = process.env.SERVER_PORT
|
||||
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()
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user