morejava.util.concurrent.ThreadPoolExecutor.runWorker[enter link description here[][1]][1[]][1] [closed]

at bnch.run(PG:1)

at bcrs.run(PG:1)

at

java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)

at

java.util.concurrent.ThreadPoolExecutor$Worker.ru

n(ThreadPoolExecutor.java:641)

at bcqx.run(PG:2)

at bcrd.run(PG:4)

Caused by: java.lang.NullPointerException:

getString(i++) must not be null

at java.lang.Thread.run(Thread.java:920) at bsnb.a(PG:1)

at vnb.invoke(PG:4)

at vnh.a(PG:5)

at bsnh.a(PG:2)

at bsmh.d(PG:2)

at bsmj.run(PG:9)

6 more

Caused by: vko

at vld.h(PG:1)

at vld.d(PG:1)

vnm.f(PG:6)

at vnm.d(PG:11)

at vne.cZ(PG:3)

at cbuf.o(PG:4)

at ccds.run(PG:14)

at bnch.run(PG:1)

6 more

by: vko

at vld.g(PG:3)

at vol.a(PG:4)

at bnct.run(Unknown Source:6)

at boei.run(PG:2)

6 morejava.util.concurrent.ThreadPoolExecutor.runWorker[enter link description here[][1]][1]enter link description herehttps://

How to automate the order according to the razorpay payment status

So I am making a webapp integrating the razorpay’s payment gateway,
I am not able to identify why is the order being when I click these

This is Cancel Button on the Razorpay’s popup

This is the button to Confirm Cancel the Payment

when I click here technically the payment is unsuccessful but still the order is being sent, which I could not find a solution for.

especially, when a payment is unsuccessful or cancelled order should not placed.

I tried For the Payment status but still could not achieve the feature to actually not send the order details until the payment is done or successful.

This is how my order controller looks

const placeOrder = async (req, res) => {
    try {
        const { userId, items, amount, address, color } = req.body


        const orderData = {
            userId,
            items,
            address,
            amount,
            paymentMethod: "COD",
            payment: false,
            date: Date.now()
        }
        console.log(orderData)
        const newOrder = new orderModel(orderData)
        await newOrder.save()
        await userModel.findByIdAndUpdate(userId, { cartData: {} })

        res.json({ success: true, message: "Order Placed" })
    } catch (error) {
        console.log(error)
        res.json({ success: false, message: error.message })
    }
}

// Create Razorpay Order
const placeOrderRazorpay = async (req, res) => {
  try {
    const { userId, items, amount, address } = req.body;

    const newOrder = new orderModel({
      userId,
      items,
      address,
      amount,
      paymentMethod: "Razorpay",
      payment: false, // Payment status is false initially
      date: Date.now(),
    });

    await newOrder.save();

    const options = {
      amount: amount * 100, // Amount in paise (Razorpay expects paise)
      currency: "INR",
      receipt: newOrder._id.toString(), // This will be used later to identify the order
    };

    razorpayInstance.orders.create(options, (err, order) => {
      if (err) {
        console.log(err);
        return res.json({ success: false, message: "Failed to create Razorpay order" });
      }
      res.json({ success: true, order });
    });
  } catch (error) {
    console.log(error);
    res.json({ success: false, message: error.message });
  }
};

// Verify Razorpay Payment
const verifyRazorpay = async (req, res) => {
  try {
    const { razorpay_order_id, razorpay_payment_id, razorpay_signature, userId } = req.body;

    // Generate the Razorpay signature from the server-side
    const generated_signature = crypto
      .createHmac("sha256", process.env.RAZORPAY_KEY_SECRET)
      .update(razorpay_order_id + "|" + razorpay_payment_id)
      .digest("hex");

    // Check if the signature matches
    if (generated_signature !== razorpay_signature) {
      return res.json({ success: false, message: "Invalid signature" });
    }

    // Update the order to indicate payment has been completed
    const updatedOrder = await orderModel.findByIdAndUpdate(
      razorpay_order_id,
      { payment: true }, // Mark payment as true
      { new: true }
    );

    if (!updatedOrder) {
      return res.json({ success: false, message: "Order not found" });
    }

    // Clear the user's cart data upon successful payment
    await userModel.findByIdAndUpdate(userId, { cartData: {} });

    res.json({ success: true, message: "Payment verified successfully" });
  } catch (error) {
    console.log(error);
    res.json({ success: false, message: error.message });
  }
};

This is how I am handling the verify payment in my frontend

const Verify = () => {
  const {
    navigate,
    token,
    backendUrl,
    user,
    setCartItems,
  } = useContext(ShopContext);

  const [searchParams] = useSearchParams();
  const razorpay_order_id = searchParams.get("order_id");
  const razorpay_payment_id = searchParams.get("razorpay_payment_id");
  const razorpay_signature = searchParams.get("razorpay_signature");

  const [loading, setLoading] = useState(false);

  const verifyPayment = async () => {
    if (!razorpay_order_id || !razorpay_payment_id || !razorpay_signature || !user._id) {
      toast.error("Payment details are incomplete.");
      setTimeout(() => navigate("/place-order"), 5000);
      return;
    }

    try {
      setLoading(true); // Start loading

      const res = await axios.post(
        `${backendUrl}/api/order/verifyRazorpay`,
        {
          razorpay_order_id,
          razorpay_payment_id,
          razorpay_signature,
          userId: user._id,
        },
        {
          headers: { token },
        }
      );

      if (res.data.success) {
        toast.success("Payment successful!");
        setCartItems({}); // Clear cart after successful payment
        setTimeout(() => navigate("/cart"), 3000); // Navigate to cart page after success
      } else {
        toast.error("Payment failed. If money was deducted, contact support.");
        setTimeout(() => navigate("/place-order"), 7000); // Redirect back to place order page if payment fails
      }
    } catch (err) {
      console.log(err);
      toast.error("Verification error. Try again.");
      setTimeout(() => navigate("/place-order"), 7000); // Redirect back to place order page in case of an error
    } finally {
      setLoading(false); // Stop loading
    }
  };

  useEffect(() => {
    if (razorpay_payment_id && razorpay_signature && razorpay_order_id && token) {
      verifyPayment(); // Verify payment if the necessary params are present
    } else {
      toast.error("Payment not completed.");
      setTimeout(() => navigate("/place-order"), 5000); // Redirect if payment details are not valid
    }
  }, [razorpay_payment_id, razorpay_signature, razorpay_order_id, token]);

Any help regrading this is really appreciated Thank you.

How to check when window becomes available?

I am new to SvelteKit and I am not familiar with SSR. I have recently learned that window is only defined after the client-side has been loaded, which can be determined with the onMount hook.

But here’s something that I am not clear on. Let’s say I have the following component:

<script lang="ts">
  const getRem = (rem: number) => rem * 
    parseFloat(getComputedStyle(document.documentElement).fontSize)
  const sizeOfSomeOtherElement = getRem(4) // returns the px value of 4rem
  const sizeOfThisElement = sizeOfSomeOtherElement * 0.5
</script> 

<div style="width: {sizeOfThisElement}rem"></div>

Now I understand in this particular example I can just use CSS calc, but let’s pretend that I have to use a JavaScript value for the sake of argument. Here, I want to dynamically get the value of a rem as it could be different based on the user.

This will throw an error telling me that getComputedStyle is not defined, as window is not defined. Now, I could delay the rendering of the element and wait until the component is mounted once like so:

<script lang="ts">
let isLoaded = $state(false)
onMount(() => { isLoaded = true })
/* ... other conditionals ... */
</script>

{#if isLoaded)
  <div style="width: {sizeOfThisElement}rem"></div>
{/if}

But this delays the rendering of the component by a slight, but noticeable amount. It doesn’t seem to be the right solution to me, as I don’t need the component to be mounted, I just need the variable window to be available, which I would think comes before mounting.

What’s the best way to tackle this? Am I misunderstanding anything?

I can’t delete previously selected data in choice.js

Here I have a problem using choice.js, where the data selected in the first dropdown still appears in other dropdowns. Here I have added a dropdown update function in other functions, the results are still the same. data still appears in all dropdowns even though it has been selected

I use choice.js it is used to be responsive from desktop to mobile. maybe there are options other than choice.js?

function initChoicesOnNewSelect(selectElement) {
  if (!$(selectElement).hasClass('choices-initialized')) {
    new Choices(selectElement, {
      searchEnabled: false,
      itemSelectText: '',
    });
    $(selectElement).addClass('choices-initialized');
  }
}

function updateDropdownOptions() {
  var selectedValues = [];

  // Ambil semua nilai yang sudah dipilih di dropdown
  $('.gejala-select').each(function() {
    var selectedValue = $(this).val();
    if (selectedValue !== "") {
      selectedValues.push(selectedValue);
    }
  });

  $('.gejala-select').each(function() {
    var currentSelect = $(this);
    var currentValue = currentSelect.val();

    currentSelect.find('option').each(function() {
      var optionValue = $(this).val();
      if (optionValue !== "" && selectedValues.includes(optionValue) && optionValue !== currentValue) {
        $(this).prop('disabled', true);
      } else {
        $(this).prop('disabled', false);
      }
    });
  });


  $(".gejala-wrapper").each(function(index) {
    if (index === 0) {
      $(this).find(".btn-hapus-gejala").hide();
    } else {
      $(this).find(".btn-hapus-gejala").show();
    }
  });
}

$(document).ready(function() {
  $(".btn-tambah-gejala").click(function() {
    var newDropdown = `
      <div class="form-group gejala-wrapper">
        <div class="select-wrapper">
            <select name="gejala[]" class="form-control input-lg mt-2 gejala-select">
                <option value="">Pilih Gejala</option>
                @foreach($gejala_list as $gejala)
                <option value="{{ $gejala->kode_gejala }}">{{ $gejala->nama_gejala }}</option>
                @endforeach
            </select>
        </div>
        <button type="button" class="btn btn-danger btn-hapus-gejala">Hapus</button>
      </div>`;
    $("#gejala-container").append(newDropdown);

    let newSelect = $("#gejala-container .gejala-select").last()[0];
    initChoicesOnNewSelect(newSelect);

    updateDropdownOptions();
  });

  $(document).on("click", ".btn-hapus-gejala", function() {
    if ($('.gejala-wrapper').length > 1) {
      $(this).closest(".gejala-wrapper").remove();
      updateDropdownOptions();
    }
  });

  $(document).on('change', '.gejala-select', function() {
    updateDropdownOptions();
  });

  $(".gejala-select").each(function() {
    initChoicesOnNewSelect(this);
  });

  updateDropdownOptions();
});

Angular Compound Dropdown Component Loses Selection on Subsequent Choices

I’m creating a compound dropdown component in Angular where items can contain custom components. The initial selection works, but subsequent selections clear the previous choice. Here’s my implementation:

Dropdown Component (app-dropdown):

import { DropdownitemComponent } from './dropdownitem.component';

@Component({
 selector: 'app-dropdown',
 template: `
   <div class="dropdown-container">
     <div class="selected-area" (click)="toggleOpen()">
       <ng-container #selectedContainer></ng-container>
       <span *ngIf="!selectedView">Please select</span>
     </div>

     <div class="items-container" *ngIf="isOpen">
       <div class="dropdown-item" 
            *ngFor="let item of items"
            (click)="selectItem(item)">
         <ng-container *ngTemplateOutlet="item.contentTemplate"></ng-container>
       </div>
     </div>
   </div>
 `
})
export class DropdownComponent {
 isOpen = false;
 selectedView: any;

 @ContentChildren(DropdownitemComponent) items!: QueryList<DropdownitemComponent>;
 @ViewChild('selectedContainer', { read: ViewContainerRef }) selectedContainer!: ViewContainerRef;

 toggleOpen() { this.isOpen = !this.isOpen; }

 selectItem(item: DropdownitemComponent) {
   this.selectedContainer.clear();
   this.selectedView = item.contentTemplate.createEmbeddedView({});
   this.selectedContainer.insert(this.selectedView);
   this.isOpen = false;
 }
} 

Dropdown Item Component (app-dropdownitem):

import { Component, TemplateRef, ViewChild } from '@angular/core';

@Component({
 selector: 'app-dropdownitem',
 template: `
   <ng-template #contentTemplate>
     <ng-content></ng-content>
   </ng-template>
 `
})
export class DropdownitemComponent {
 @ViewChild('contentTemplate') contentTemplate!: TemplateRef<any>;
}

Usage:

<app-dropdown>
 <app-dropdownitem>
   <app-custom-component></app-custom-component>
 </app-dropdownitem>
 <app-dropdownitem>
   <div class="custom-item">Test</div>
 </app-dropdownitem>
</app-dropdown>

The Problem:


What I’ve Tried:

Using *ngTemplateOutlet directly

Tracking by index instead of template references

Angular CDK Portal approach

Manual view management with ViewContainerRef

Key Requirements:

Must support arbitrary components in dropdown items

Selected item should fully render its content

Compound component pattern must be maintained

Why does the selection fail after the first choice? How can I make selections persist across multiple interactions while maintaining the compound component structure?

Filter object array with another array negatively [duplicate]

I want to filter an object array by key’s value, with another array, and return what’s not present in the filter.

Input:

pass = { c:107, x:16, y:0 },{ c:108, x:18, y:0 },{ c:109, x:16, y:0 }
fail = [107,108]

Result should be:

pass = { c:109, x:16, y:0 }

I came up with a code, but it filters out the objects I don’t need:

pass.filter(obj => fail.some(el => el == obj.c));

Any suggestions?

jQuery ajax promise not resolving in Chrome iOS mobile

Similar questions

Context

Server is in my local network, serving HTTP (not HTTPS).

Passing web client is on Chrome macOS version 135.0.7049.85.

Failing web client is on Chrome iOS version 135.0.7049.83.

I’ve confirmed that CORS is not the issue, and I can see server logs accepting the request and returning response.

I tried disabling “safe browsing” in Chrome settings, no change.

Web client

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

JS

async function f1() {
  console.log('before request')

  const res_subs = await $.ajax({
    method: 'POST',
    url: '/db',
    data: {
      endpoint: 'endpoint1',
      value: 'one two',
      language: 'abc'
    }
  })

  console.log('after request')
}

Output

before request

after request is never printed.

Why is my Javascript script not running when its declared as type ‘module’?

So usually when I create a simple HTML/CSS/JS setup, I insert the script tag at the end of the html like this:

<script src="./script.js" />

And then inside the script file, I add all the event listeners like:

document.addEventListener("mousemove", trackMouse);

Then when I move the mouse I am able to trigger that trackMouse functions.

However when I declare the script tag as:

<script src="./script.js" type="module"> </script>

Then this does not work. Nothing is happening when I move the mouse. I even added a console log at the start of the script tag, but its not showing on the console.

But why? I just want to use the script file in the same way as I did before however I want the script.js file to have the additional functionality of it being able to import other javascript classes into itself.

How to work around Chromium-based browsers’ broken audio MediaStreamTrack implementation that doesn’t produce silence?

The specification for MediaStreamTrack is located in W3C Media Capture and Streams.

In pertinent part at 4.3.1.1 Media Flow

The result for the consumer is the same in the sense that whenever MediaStreamTrack
is muted or disabled (or both) the consumer gets zero-information-content, which means silence for audio and black frames for video. In other words,
media from the source only flows when a MediaStreamTrack object is both unmuted and
enabled. For example, a video element sourced by a MediaStream containing only muted or
disabled MediaStreamTracks for audio and video, is playing but
rendering black video frames in silence.

For a newly created MediaStreamTrack object, the following applies: the track is always
enabled unless stated otherwise (for example when cloned) and the muted state reflects the state of the source at the time the track is created.

Chrome’s implementation of MediaStreamTrack of kind audio does not render silence per the specification. See MediaStreamTrack does not render silence.

React Not Displaying Fetched API Data on Page (Data Shows in console.log but Not Rendering)

I am working on a Hall Booking Project, and I am facing an issue where React is not displaying data fetched from the backend API.

The API call is successful — data shows properly in console.log() — but it does not render on the page.

Here is my React component code:

import useUserContext from './useUserContext';
import useApi from './useApi';
import { getUSerData } from './api';

function Home() {
  const { loading, error } = useUserContext();
  const [data, setData] = useState(null);
  const { callApi } = useApi();

  const getData = async () => {
    try {
      const response = await callApi(getUSerData);
      console.log("API response:", response);
      if (response && response.success) {
        setData(response.user);
        console.log("Data set:", response.user);
      } else {
        console.log("DATA NOT FOUND");
        setData(null);
      }
    } catch (err) {
      console.error("Error fetching user data:", err);
      setData(null);
    }
  };

  return (
    <div>
      <h3 className='text-center text-4xl font-semibold font-serif text-gray-600'>
        HOME
      </h3>

      {loading && <p className='text-center text-2xl font-semibold font-serif text-gray-600'>Loading...</p>}
      {error && <p className='text-center text-2xl font-semibold font-serif text-gray-600'>{error}</p>}

      <button
        onClick={getData}
        className="bg-blue-500 text-white font-bold py-2 px-4 rounded hover:bg-blue-700 transition duration-300"
      >
        GET DATA
      </button>

      {data ? (
        <div className='text-center text-2xl font-semibold font-serif text-gray-600'>
          <p>Name: {data.name}</p>
          <p>Email: {data.email}</p>
          <p>Contact No: {data.contactNo}</p>
        </div>
      ) : (
        <p className='text-center text-2xl font-semibold font-serif text-gray-600'>Data Not Found</p>
      )}
    </div>
  );
}

Here is my custom hook used to call API:

import useUserContext from "./useUserContext";

const useApi = () => {
  const { setLoading, setError } = useUserContext();

  const callApi = async (apiFunction) => {
      try {
          setLoading && setLoading(true);
          return await apiFunction();
      } catch (error) {
          setError && setError(error.response?.data?.message || 'Something went wrong');
          throw error;
      } finally {
          setLoading && setLoading(false);
      }
  };

  return { callApi };
};

export default useApi;

The getUserData method:

const getUSerData = async () => {
  const response = await axios.get(
    `${API_URL}/getuser`,
    { withCredentials: true }
  );
  
  return response.data;
}

Here is the output screenshot:

Now, if I use this direct method, it works and displays data properly:

function Home() {
  const [userData, setUserData] = React.useState(null);

  const getUserData = async () => {
    try {
      const response = await axios.get(
        'http://localhost:3360/api/v1/users/getuser',
        { withCredentials: true }
      );
      console.log("Data Fetched ", response);
      if (response.data && response.data.success) {
        setUserData(response.data.user);
      } else {
        setUserData(null);
      }
    } catch (error) {
      console.log(error);
      setUserData(null);
    }
  }

  return (
    <div>
      <h3>HOME</h3>
      <button
        className="border px-3 py-1.5 m-5 bg-transparent shadow-xl rounded hover:bg-indigo-500 hover:text-white transition-colors"
        onClick={getUserData}>Fetch</button>
      {userData ? (
        <div>
          <h3>User Data:</h3>
          <p>Name: {userData.name}</p>
          <p>Email: {userData.email}</p>
          <p>Contact: {userData.contactNo}</p>
        </div>
      ) : (
        <h3>No user data available</h3>
      )}
    </div>
  );
}

Question Summary:

✅ Data fetch is working and shown in console.

❌ But in my reusable hook method, data is not displayed in UI.

✅ When I use axios.get() directly inside the component, it works fine.

Please help me understand:

Why is my reusable hook method not working?

How can I fix it to display data properly?

Thanks in advance!

cannot be loaded because running scripts is disabled on this system

npm : File C:Program Filesnodejsnpm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Exestrong textcution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
strong text

Answer is:

create app
if there is create problem to intall any thing just do it:
PS C:Usersanand> Get-ExecutionPolicy // first run this
Restricted // if restricted run below code
PS C:Usersanand> Set-ExecutionPolicy -Scope CurrentUser

cmdlet Set-ExecutionPolicy at command pipeline position 1
Supply values for the following parameters:
ExecutionPolicy: RemoteSigned // remotesigned in run

  1. install node
  2. npm install
  3. create npm vite@latest
  4. choose react and javascript
  5. goto in directory into project name and now work on projects

How to get Firefox’s WebTransport client to work with Deno’s WebTransport server implementation?

Deno’s WebTransport server implementation works when Deno WebTransport client is used, and works when Chromium browser (Version 137.0.7124.0 (Developer Build) (64-bit)) is a client. The clients don’t work exactly the same. Deno’s client only handles around 2 MB echoed, Chromium’s client can handle 7 MB echoed. Firefox Nightly (139.0a1 (2025-04-12) (64-bit)) just hangs and doesn’t do anything.

I’ve filed a Firefox bug WebTransport connection rejected using self-signed certificates. Firefox folks have reproduced the issue. So far no solution or workaround has been achieved.

I’m wondering if anybody in the field has successfully used Firefox as a client for Deno’s WebTransport server implementation?

Checking for mouse hover in p5.js with a varying perspective

I’m making a 3-axis graph which the user can interact with and adjust the perspective. I’d like to implement a function that checks if the cursor is hovering over any of the elements of the graph, so that when the user points at an element, extra bit of information can be displayed. I’d like to know if something like this is possible for a free-perspective 3D, and if so, the method. Thank You!

Here is the code I’m working with

function preload() {
  font = loadFont("Courier New.ttf");
}

function setup() {
  createCanvas(700, 700, WEBGL);
  textFont(font);
  textSize(30);
  textAlign(CENTER, CENTER);
  frameRate(60);

  //debugMode()
}

function graph() {
  // graph axis
  noFill();
  stroke(2);
  box(500, 500);

  fill("black");
  text("<---Humor---------Horror--->", 0, 250);
  push();
  rotateY(-HALF_PI);
  text("<---:D----------------D:--->", 0, 250);
  pop();
  push();
  rotateZ(HALF_PI);
  translate(0, -500);
  text("<---LA----------------NY--->", 0, 250);
  pop();
}

function elements() {
  let x = 100;
  let y = 20;
  let z = -100;

  push();
  translate(x, y, z);
  noStroke();
  fill("red");
  sphere(5)
  
  pop();
}

function draw() {
  background("white");
  orbitControl();
  graph();
  elements();
}

Checking for mouse hover in WEBGL with a varying perspective, p5.js

I’m making a 3-axis graph which the user can interact with and adjust the perspective. I’d like to implement a function that checks if the cursor is hovering over any of the elements of the graph, so that when the user points at an element, extra bit of information can be displayed. I’d like to know if something like this is possible for a free-perspective 3D, and if so, the method. Thank You!

Here is the code I’m working with

function preload() {
  font = loadFont("Courier New.ttf");
}

function setup() {
  createCanvas(700, 700, WEBGL);
  textFont(font);
  textSize(30);
  textAlign(CENTER, CENTER);
  frameRate(60);

  //debugMode()
}

function graph() {
  // graph axis
  noFill();
  stroke(2);
  box(500, 500);

  fill("black");
  text("<---Humor---------Horror--->", 0, 250);
  push();
  rotateY(-HALF_PI);
  text("<---:D----------------D:--->", 0, 250);
  pop();
  push();
  rotateZ(HALF_PI);
  translate(0, -500);
  text("<---LA----------------NY--->", 0, 250);
  pop();
}

function elements() {
  let x = 100;
  let y = 20;
  let z = -100;

  push();
  translate(x, y, z);
  noStroke();
  fill("red");
  sphere(5)
  
  pop();
}

function draw() {
  background("white");
  orbitControl();
  graph();
  elements();
}

how do you call multiple methods from javascript

I have a method in javascript and inside this method I need to call three method on server and each will return part of some data and then I need to call another method in javascript and pass it all three results from server.

function LoadMAData(sessionId) {
$.ajax({
    url: 'Home/GetDataA',
    type: 'GET',
    dataType: 'json',
    data: {
        sessionId: sessionId
    },
    success: function (dataA) {
        $.ajax({
            url: 'Home/GetDataB',
            type: 'GET',
            dataType: 'json',
            data: {
                sessionId: sessionId
            },
            success: function (dataB) {
                $.ajax({
                    url: 'Home/GetDataC',
                    type: 'GET',
                    dataType: 'json',
                    data: {
                        sessionId: sessionId
                    },
                    success: function (dataC) {
                        ShowMAs(dataA, dataB, dataC);
                    }
                });
            },
            error: function (err) {
                console.log(err.responseText);
            }
        });
    }
});
}

This works, but I feel like this is the worst possible way how to do it, I wait for each call to finish and call another. And it takes some time.
So, I tried to rewrite it to promises but alas, it doesnt work.

var promises = [];
let dataA;
let dataB;
let dataC;
promises.push(function () {
$.ajax({
    url: 'Home/GetDataA',
    type: 'GET',
    dataType: 'json',
    data: {
        sessionId: sessionId
    },
    success: function (_data) {
        dataA = _data;
        return 1;
    }
});
});
promises.push(function () {
$.ajax({
    url: 'Home/GetDataB',
    type: 'GET',
    dataType: 'json',
    data: {
        sessionId: sessionId
    },
    success: function (_data) {
        dataB = _data;
        return 2;
    }
});
});
promises.push(function () {
$.ajax({
    url: 'Home/GetDataC',
    type: 'GET',
    dataType: 'json',
    data: {
        sessionId: sessionId
    },
    success: function (_data) {
        dataC = _data;
        return 3;
    }
});
});
Promise.all(promises).then(x => {
ShowMAs(dataA, dataB, dataC);
}, err => {
    console.log('error')
});

Can you help me, please?