Skip to content

Commit

Permalink
hitting backend correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeaux committed Sep 16, 2020
1 parent 308e94e commit c7fc641
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
19 changes: 5 additions & 14 deletions controllers/backend/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const mailTransports = require('../../config/nodemailer');

const importerDownloadFunction = require('../../lib/uploading/importer');

importerDownloadFunction('anthony', 'https://www.youtube.com/watch?v=vLJgAAIfKEc');
// importerDownloadFunction('anthony', 'https://www.youtube.com/watch?v=vLJgAAIfKEc');

console.log('importer');
console.log(importerDownloadFunction);
// console.log('importer');
// console.log(importerDownloadFunction);

const mailgunTransport = mailTransports.mailgunTransport;

Expand Down Expand Up @@ -487,16 +487,7 @@ exports.postConfirmEmail = async(req, res, next) => {
*/
exports.postImporter = (req, res) => {

const recaptchaPublicKey = process.env.RECAPTCHA_SITEKEY;
console.log(req.body);

const captchaOn = process.env.RECAPTCHA_ON == 'true';

if(!req.user){
return res.redirect('/login');
}
res.render('account/importer', {
title: 'Create Account',
recaptchaPublicKey,
captchaOn
});
return res.send('hello');
};
9 changes: 5 additions & 4 deletions views/account/importer.pug
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ block content
$(document).ready(function(){
$('.submit-button').click(function () {

var csrf = '#{csrf}'
var csrf = '#{_csrf}'

var data = {
_csrf: csrf,
_csrf: csrf
}

var thing = $('.importInput').val()
Expand All @@ -84,17 +84,18 @@ block content
if(thing){
$.ajax({
type: 'POST',
url: `/postImporter`,
url: `/importer`,
data,
success: function (data) {
alert(data);

console.log(data);
},
error: function (err) {
console.log(err);
}
});

alert(thing);
}
console.log('hit!');
console.log(thing);
Expand Down
2 changes: 1 addition & 1 deletion views/viewPartials/uploadDetails.pug
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ style.
}

.durationTime {
color: #c0c0c0;;
color: #959595;
}

div.underThing
Expand Down

0 comments on commit c7fc641

Please sign in to comment.