Categories
Mastering Development

Node js form submit TypeError: Cannot set property ‘userId’ of undefined

I have added login and registration features to a page in my application in views/employee/login.hbs. When I enter in registration details (email, username, password and conf password), I hit the register button to hopefully be redirected to the views/employee/home.hbs page. However, when I complete this action my MongoDB Compass Community database receives the registration details […]

Categories
Mastering Development

Cross-Origin Request Blocked when requesting Paypal sandbox but a different localhost port works fine

I’m having trouble understanding why I’m getting a Cross-Origin Request Blocked error when trying to send a user in my app to a sandbox.paypal.com payment page when ordering a product. The frontend of my app (with React) uses localhost port 3000 while the backend uses localhost port 4000. The communication between the two ports when […]

Categories
Mastering Development

How to integrate React Native with mySQL

I’m new in React Native and I’m trying to integrate my app with mySQL database located inside my hosting provider (digitalocean.com). I’ve managed to get the data through nodejs and express but it’s actually getting the data where my problem is. Here how it goes: I created a routes.js and inserted the following: Note: the […]

Categories
Mastering Development

node, express, mysql update multiple rows different value arrays

I am trying to use node/express to pass 2 separate arrays to update mysql, one array has the record id’s to update and the other has the values. It is for an api endpoint to mark the sort order for folders in an app. the app will send an array of folderID’s in the proper […]

Categories
Cryptocurrency Development Ethereum

listening for solidity event with Javascript

I am attempting to make a simple guessing game. Game rules: Player 1 initiates the game with a contract address, upper bound, lower bound and answer. Player 2 has 10 guesses to guess the answer or they loose. Player 2 can see previous guesses and ask if their last guess is within ‘x’ of the […]

Categories
Mastering Development

Clearing Cookies Programmatically is not working in Postman and Newman

I need to be able to delete cookies automatically in between requests when they I run my collection of requests in Newman and Postman Runner (mainly Newman). I followed the suggestion given in this comment by a person from Postman: https://github.com/postmanlabs/postman-app-support/issues/3312#issuecomment-516965288. But it is not working. The answer to these two SO questions also tell […]

Categories
Mastering Development

I can’t change the value in the database – array

I need to update the comment status, i.e. the name of the “approve” field. To this end, I created the AJAX script also the backend seems correct because it receives a message after clicking the button. I don’t know why I can’t save the “approve” value to the database. Please help. I use NodeJS, MongoDB, […]

Categories
Cryptocurrency Development Ethereum

Web3.JS 1.2.6 reporting PastEvents but not new events

relevant code: token.getPastEvents(‘Approval’, { fromBlock: 0, toBlock: ‘latest’ }, function (error, events) { console.log(“ETHEREUM past events ” + JSON.stringify(events)); }); token.events.Approval({ fromBlock: 0 }, function (error, event) { console.log(“NEW ETHEREUM EVENT ” + JSON.stringify(event)); }) token.events.allEvents({ fromBlock: 0 }, function (error, event) { console.log(“NEW ETHEREUM EVENT ” + JSON.stringify(event)); }) First call works perfectly. The […]

Categories
Development

Confusion surrounding async and return statements

What I am trying to do is to make a request to a Web API and then if the input is valid return true from a function and if it is not valid return false. I want the request to be async but I don’t want the function to return before the request is validated. […]

Categories
Development

createBlobFromLocalFile should be a non-empty string – azure blob storage

I’m trying to upload a file to azure blob storage. I’m receiving it on the backend, but I keep getting the error createBlobFromLocalFile should be a non-empty string I”m receiving the file as you can see in console output, but I don’t understand why I can’t send it to blob storage. I’ve tried replacing the […]