Categories
Mastering Development

How to send a link in the sendgrid email message body?

I am implementing password reset functionality in a MERN app. Whenever a user enters the email for which they want to reset the password and clicks on the "Send Password Link" button, a POST request is made to "/account/forgot". In the route handler function, I want to send them a password reset link in the […]

Categories
Mastering Development

coverage test failure on a class that extends a base class

[Update: including example] I am having coverage issues on ChildClass which extends ParentClass in a react-native app. Code and coverage report is below. The issue is deployment is being blocked by some script that checks for minimum coverage. Any idea what I am doing wrong exactly? functions.js export function calculateContribution(salary, group){ return salary * 0.5; […]

Categories
Mastering Development

How to make a rigid alternative constraint based on earn value

i want to make a rescheduling model. I have 2 modes in tuple, I declare it using ID, I want to make a constraint if the costprod * duration in present’s mode in day 1-7 <= earn value than choose mode 2. But I think something missing in model. but I didn’t know where is […]

Categories
Mastering Development

Multiple args.split().join(” “) discord.js

So I am making a discord bot using Discord.js. In the bot, there is a command where you can do a giveaway ping and the bot will send a embed with the sponsor, prize, and message. But I need all of these different arguments to have args.slice().join(" "). const Discord = require(‘discord.js’); module.exports = { […]

Categories
Cryptocurrency Ethereum Mastering Development

“Truffle Networks” spits out error and can’t migrate to Mainnet

I’m trying to deploy to Mainnet (for the first time) but the initial migration (1_initial_migration) is getting stuck. Deploying to Kovan works fine and is super fast. I have enough Eth to deploy to Mainnet. I’ve attempted it few times, and it get stuck. I’m running this command to find out the addresses of my […]

Categories
Cryptocurrency Ethereum Mastering Development

how to use send function of metamask to send erc20 token through send transaction

transactionParameters:any = { // nonce: ‘0x05’, // ignored by MetaMask gas: ‘0x88B8’, // customizable by user during MetaMask confirmation. to: this.contractAddress, from: window.ethereum.selectedAddress, // value: ‘0x10′, // Only required to send ether to the recipient from the initiating external account. // data: , // Optional, but used for defining smart contract creation and interaction. data:’0xa9059cbb00000000000000000000000038be032340C655CF40cfCa95976c157850ACFe9E0000000000000000000000000000000000000000000000000000000000989680’, […]

Categories
Mastering Development

Node Lambda: MySQL query never runs

Testing with Postman, I’ll try to make this as clear as possible, please advise if this is not making sense. I have a Lambda that uses MySQL RDS database on AWS and works fine locally when accessing the database on AWS. After successfully getting a JWT from an auth endpoint I try to hit the […]

Categories
Mastering Development

Discord.js message.embeds[0] not outputting anything;

I’ve been trying to program a discord bot to play hangman except I’m doing it in embeds to learn how they work. Unfortunately, I’ve been at a roadblock trying to resend my embed after they got a letter right or not. I tried to follow the discord.js guide and use the message.embeds[0] command but it […]

Categories
Mastering Development

How can I find which category has the most products shipped and the net income from sales in that category?

Using the w3schools.com SQL tutorial Northwind database, I’m trying to display the category that has the most products shipped. Additionally, I want to display the net income from all sales in that category. I can’t figure out how to take the category with the most products shipped, and use the amount of products shipped to […]

Categories
Mastering Development

how can i make this command loop? [Discord.js]

I have this command but I don’t have an idea how to make it loop until I turn off the bot. I will be really grateful if you can help me. I have to mention that I need the message to keep changing. the code I want to loop is this: module.exports = { name: […]