Categories
Mastering Development

Dispatch function seems to run more than one time after I test on stand alone app

it sound so weird to me and I have no idea what’s wrong here because everything is fine in development environment. so the way app works is simple, user sign in, choose it’s therapist then pay for it and after successful pay, booking is confirm, but the problem is booking is being booked exactly 3 […]

Categories
Mastering Development

how can you make an API change its data?

This is the code I have, when it is clicked it should detect the URL inputted in a form, and then it runs a scraper that prints out the emails found on the URL. I want the results to be printed on the same page. How should I make my API to achieve this? Javascript […]

Categories
CMS Drupal Mastering Development

Passing option value into webservice in Drupal 8 Webform JS

I am trying to pass an option value into a webservice using Drupal 8 webform JS, after doing an onchange for an element. Anyone mind pointing me on the right path? Thank you so much. What I have so far… (function($, Drupal) { Drupal.behaviors.getValue = { attach: function(context, settings) { $(document.body).on(‘change’,"value",function (e) { var optVal= […]

Categories
Mastering Development

Django foreign key field not updating with selected value from React Select dropdown

I have a webpage in my issue tracker project that allows a project manager to assign a user to a project. I am using React Select to allow the manager to select a user from a dropdown. When they click the add user button, the selected value gets sent to the backend through an api […]

Categories
Mastering Development

Interceptor for fetch and fetch retry? (Javascript)

I am trying to create an interceptor for fetch in javascript (React to be more specific). It should get the result from every fetch that gets called, and if it is an 401 error it should initiate a new fetch call to another route to get a cookie (a refresh token). Then, the original fetch […]

Categories
Mastering Development

Fetch No ‘Access-Control-Allow-Origin’ header is present AWS api gateway

I am trying to send a fetch request to AWS API gateway but it keeps giving me this error. I am doing it from the admin side in WordPress. Access to fetch at ‘https://34557322456.execute-api.ap-southeast-1.amazonaws.com/V1/code?kdata=something’ from origin ‘https://mywebsite.online’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header […]

Categories
Mastering Development

AWS NodeJS Lambda email function not working correctly

I have a AWS Lambda that first gets data from an external API endpoint and then will loop the json data and will send email to each of the records. Here is the code: var aws = require("aws-sdk"); var ses = new aws.SES({ region: "us-east-1" }); const https = require(‘https’); exports.handler = async function(event, context) […]

Categories
Mastering Development

Object Not Passing/Fetch-Post Request/API/NodeJS/Browser

Issue: An object created in JavaScript by input data from a sign up form in HTML does not seem to be created. Tried: I checked if I was referencing the entire object with {data} rather just data Searched other online resources to no avail Read again on JavaScript objects to see if I did a […]

Categories
Mastering Development

Can’t perform a React state update on an unmounted component with fetch POST method

I get this warning when i use my fetch post method how can I cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.With my Post methods. Warning: Can’t perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel […]

Categories
Mastering Development

How to solve icon toggle on add/remove to favourite in React

Hey there i am having some trouble when adding/deleting a favourite. When i toggle the heart icon it does what it is supposed to in the backend, so it adds or it removes correctly an item from the favourites. The issue is that if i add an item to favourites, the icon becomes a full […]