Azure Functions CosmosDB input binding using HTTP request userId value

I have a basic azure function written in the v4 programming model. I want it to use the user id available from the http request to go to the database and get a document representing the user’s details. The below returns a 500 server error as request is undefined outside the handler.

const { app, input } = require('@azure/functions');

const cosmosInput = input.cosmosDB({
  databaseName: 'rcmapp',
  collectionName: 'users',
  id: '{request.user.id}',
  partitionKey: '{request.user.id}',
  connectionStringSetting: 'COSMOS_CONNECTION_STRING'
});

app.http('userDetails', {
  methods: ['GET'],
  authLevel: 'anonymous',
  extraInputs: [cosmosInput],
  handler: (request, context) => {
    context.log(`User details function triggered`);
    const userDetails = JSON.parse(context.extraInputs.get(cosmosInput));

    return {
      body: userDetails
    };
  }
});

Is there a way I can access this value to pass to the input binding using a binding expression?

I can’t figure out why an error is said to be in the matter.js script

// matter.js modules 
let Engine = Matter.Engine,
    Render = Matter.Render,
    World = Matter.World,
    Bodies = Matter.Bodies,
    Mouse = Matter.Mouse, 
    MouseConstraint = Matter.MouseConstraint;
    
// Game variables
let engine;
let world;
let renderer;

// Table variables
let table;
let pocketSize = 50;
let tableWidth = 500;
let tableHeight = 250; 

// Ball arrays
let reds = [];
let colours = [];
let pockets = [];

// Cue variables
let cueBall;
let cue;
let cueLength = 100;
let aiming = false; 

// Game state
let consecutiveColours = 0;

function setup() {

  // Canvas
  createCanvas(800, 600);
  
  // Engine
  engine = Engine.create(); 
  
  // Renderer
  renderer = Render.create({
    element: document.body,
    engine: engine,    
    options: {
        width: 800,
        height: 600,
        wireframes: false
    }
  });

  // Table body
  table = Bodies.rectangle(width / 2, height / 2, tableWidth, tableHeight, { 
    isStatic: true 
  });
  World.add(world, table);

  // Table walls
  World.add(world, [
    Bodies.rectangle(width / 2, 50, width, 100, {isStatic: true}),
    Bodies.rectangle(width / 2, height - 50, width, 100, {isStatic: true}),   
    Bodies.rectangle(50, height / 2, 100, height, {isStatic: true}),
    Bodies.rectangle(width - 50, height / 2, 100, height, {isStatic: true})
  ]);
   
  // Pockets
  let pocketOpts = { isStatic: true, isSensor: true };
  pockets.push(Bodies.rectangle(width / 2, 50, pocketSize, pocketSize, pocketOpts));
  // Add other 5 pockets
  
  // Red balls
  for(let i = 0; i < 15; i++) {
    let ball = Bodies.circle(random(tableWidth / 4, tableWidth * 3 / 4), 
                            random(100, tableHeight - 50), 15, 
                            { friction: 0.05, 
                              restitution: 0.5 
                            });
    World.add(world, ball);
    reds.push(ball);
  }
  
  // Coloured balls  
  let colourOptions = { friction: 0.05, restitution: 0.5 }; 
  colours.push(Bodies.circle(tableWidth / 4, tableHeight / 2, 15, colourOptions));
  colours.push(Bodies.circle(tableWidth * 3/4, tableHeight / 2, 15, colourOptions));

  // Cue ball
  cueBall = Bodies.circle(tableWidth / 2, tableHeight - 30, 15, 
                          { friction: 0.05, 
                            restitution: 0.8});
  World.add(world, cueBall);                           

  // Mouse control
  let mouse = Mouse.create(renderer.canvas); 
  let mConstraint = MouseConstraint.create(engine, { mouse: mouse });
  World.add(world, mConstraint);

  // Run renderer
  Render.run(renderer);
 
}

function draw() {

  // Background
  background(0, 128, 0);

  // Table  
  stroke(128);
  strokeWeight(2);  
  fill(100, 50, 0);
  rect(table.position.x - tableWidth / 2, 
        table.position.y - tableHeight / 2, 
        tableWidth, 
        tableHeight);
  
  // Balls
  for(let i = 0; i < reds.length; i++) {
    drawBall(reds[i]);
  }
  
  for(let i = 0; i < colours.length; i++) {
    drawBall(colours[i], 10);  
  }

  // Cue ball  
  drawBall(cueBall);
  
  // Cue 
  if (aiming) {
    drawCue();
  }

  // Collision messages  
  checkCueCollisions();
  
  // Update physics
  Engine.update(engine);

  // Remove pocketed reds
  reds = reds.filter(red => !red.isSensor);
  
}

// Ball function
function drawBall(ball, r = 15) {
 
  push();
  noStroke();
  fill(255); 
  circle(ball.position.x, ball.position.y, r * 2);  
  pop();
   
}

// Cue rendering  
function drawCue() {

  let x = mouseX;
  let y = mouseY; 
  if (!onTable(x, y)) {
    x = cue.position.x; 
    y = cue.position.y;
  }
  
  push();
  stroke(128);
  strokeWeight(10); 
  line(x, y, x - cueLength * cos(cue.angle),  
        y - cueLength * sin(cue.angle)); 
  pop();
  
}

// Cue ball shot
function keyPressed() {
  if (keyCode === ENTER) {
    aiming = true;
    cue = Bodies.rectangle(cueBall.position.x, cueBall.position.y, 100, 10);
    World.add(world, cue);
  }
}

// Collision messages
function checkCueCollisions() {

  // Implement collisions with balls and cushions
  
}

// Helper functions
function onTable(x, y) {

  return x >= 0 && x <= width &&  
         y >= 100 && y <= height - 100; 
  
}

This is the code I have for a snooker game using the matter.js engine. I spent the last couple hours trying to figure out where the error is. Image attached is the error I got attempting to simulate the game. Could someone help me attempt to figure out the error? Only other script I have is the matter.js script

Expected the code to simulate, got this error insteadenter image description here

How to pass multiple objects as Link params in expo-router?

I’m creating filters for firestore query and I have two objects I need to pass to the next screen.

const [property, setProperty] = useState({
    propertyType: null,
    subtype: null,
    bathrooms: null,
    bedrooms: null,
  });

  const [listing, setListing] = useState({
    foreclosure: false,
    fullyFurnished: false,
    offerType: null,
    preselling: false,
    shortTerm: false,
    priceMin: null,
    priceMax: null,
  });

I’m trying to pass it on the link like this (with origin as pathname to next screen):

<Link href={`${origin}?listing=${listing}?property=${property}`} >

But I’m not sure how to receive it on the next screen. Is it even possible to pass multiple objects or is there a better way to do this?

unexpected behavior with division in the map [closed]

I’m new with javascript.
I implemented the following function. But I don’t understand why the first division doesn’t work!

function myFunction(c) {
    let x = 0;
    let y = 0;
    let z = 0;
    console.log(c);
    c.map((element) =>
        // the first division is not performed, the other two are
        x += +(c.reduce(((acc, elem) => acc + elem[0]), 0) / c.length).toFixed(2),
        y += +(c.reduce(((acc, elem) => acc + elem[1]), 0) / c.length).toFixed(2),
        z += +(c.reduce(((acc, elem) => acc + elem[2]), 0) / c.length).toFixed(2));
    // here the division is performed
    // x /= c.length;
    
    console.log(x = ${x}, y = ${y}, z = ${z});
   return Array.of(x, y, z);
}

I expect that for x, y and z the result will have the same behavior. But is not so

How do I program a “Random button” on my Blogger site?

I want to add a button/link that redirects the user to a randomly chosen post on my Blogger site. I plan for the button to be one of the links in the page list at the top of my Blogger site and have it redirect the user to a random page with each click.

I’ve added an “HTML/JavaScript” gadget in the footer on my site and tried figuring things out from there. Unfortunately, nothing I’ve done has brought me success with this idea yet. I’ve tried having it so that when the site is loaded, the link gets a randomly chosen URL that redirects to a post on my website, however, it only picks the recent posts and not the older ones. I plan for this random link to randomly pick out of all of my posts, not just the newer ones.

Content hidden behind Navbar when using Links to IDs [duplicate]

I am using a fixed navbar. This takes it out of the document flow if I am not mistaken. I got that working by adding padding-top: Xpx; to my content. However, when I use links to div‘s it is scrolled to far and the Header of the section is hidden behind the navbar. Is there any trick to fix that? Do I need to use javascript to handle the scrolling?

<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <div
      class="navbar"
      style="
        position: fixed;
        top: 0px;
        left: 0px;
        height: 60px;
        background-color: gray;
        width: 100%;
      "
    >
      <a href="#home">Home</a>
      <a href="#about">About</a>
      <a href="#contact">Contact</a>
    </div>
    <div class="content" style="padding-top: 60px">
      <div id="Home">
        <h1>Home</h1>
        <p>
          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
          nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
          sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
          rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
          ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
          dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
          et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
          takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
          amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
          invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
          At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
          kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
          amet. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
          esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
          at vero eros et accumsan et iusto odio dignissim qui blandit praesent
          luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
          Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
          nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
          volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
          ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
        </p>
      </div>
      <div id="about">
        <h1>About</h1>
        <p>
          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
          nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
          sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
          rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
          ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
          dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
          et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
          takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
          amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
          invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
          At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
          kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
          amet. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
          esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
          at vero eros et accumsan et iusto odio dignissim qui blandit praesent
          luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
          Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
          nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
          volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
          ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
        </p>
      </div>
      <div id="contact">
        <h1>Contact</h1>
        <p>
          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
          nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
          sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
          rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
          ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
          sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
          dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
          et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
          takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
          amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
          invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
          At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
          kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
          amet. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
          esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
          at vero eros et accumsan et iusto odio dignissim qui blandit praesent
          luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
          Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
          nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
          volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
          ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
        </p>
      </div>
    </div>
    <footer>
      <div style="background-color: gray; height: 1000px; width: 100%"></div>
    </footer>
  </body>
</html>

Updating an object in React js

I have an issue in UI where, if I edit the characteristics with short labels(characteristicsValues) and change the type instead having one short labels I’m having two.
This is the UI design.
enter image description here

This is the expected output after changing the type in the dropdown.
enter image description here

And here’s what I’m currently getting after changing the type.
enter image description here

And here’s the function where dropdown triggered.

function handleCharTypeChange(e, arfId) {
    const type =
      arfId === 'Occupancy'
        ? 'Occupancy'
        : arfId === 'Construction'
        ? 'Construction'
        : e;
    const setTypes = [
      { field: 'characteristicValues', value: type },
      { field: 'characteristicType', value: e },
    ];
    if (e === 'FreeText') {
      setTypes.push({
        field: 'relevantForPricing',
        value: false,
      });
    }
    setTypes.forEach(async (f) => {
      if (f.field === 'characteristicValues') {
        if (state.characteristicValues.length > 0)
          state.characteristicValues.map((v) => {
            let t = { ...v };
            return handleChangeCharacteristicValue(
              t,
              f.value,
              'characteristicValues',
              'type'
            );
          });
      } else handleChangeCharacteristic(f.field, f.value);
    });
  }

I think the root cause was it was not clearing the existing characteristic values correctly. Because when I tried to add another short labels under Range type and changed it to FreeText it return three. I tried adding a ternary operator.

const setTypes = [
      { field: 'characteristicValues', value: type === 'FreeText' ? [] : type },
      { field: 'characteristicType', value: e },
    ];

But the issue still occur and I also tried passing empty array.

if (e === 'FreeText') {
      setTypes.push({
        field: 'characteristicValues',
        value: [],
      });
      setTypes.push({
        field: 'relevantForPricing',
        value: false,
      });
    }

But the issue still occur. It still returning two short labels. Heads up, if you ask me anything about React js. I’m sorry I really don’t have a background nor experience on handling it. And I’m still learning. I will appreciate any help and some new knowledge I could gain. Thank you!

Interview technical test – project to be done locally

I have the next interview process which is the technical test. It is a test that might take 5 days to finish because I will be creating a page using React and ASP.NET Web API. This also includes database and I will be using MySQL since I have a macbook. They asked me once I’m done I have to submit the whole project on ZIP file.

I was just wondering on how to submit the database too. Any advice on how can I send the db where they can still open the whole project locally?

thank you

Redraw function on canvas html5 element, endlessly execute

im trying to achieve a click functionality that triggers a “active”- state for one of my svg buildings on my canvas element, this worked before with the same code before i put the for-loop and if-statements, to get a pulsating effect on the buildings. However now, when i want the clicked object only to get this effect, it endlessly triggers the call in the console, and the element moves like intended, but never gets the intentional scaleing aspect

I’ve tried putting for loops, to set one of the objects in an array to active, which it does, but it doesn’t do the correct animations with translate, and scale. The translate part work, but not the pulsating scale part.

Before the following code was put into for / if statements, the effect was achieved, but not anymore… Could anyone help me see the issue? I’ve been at it for a while, but can’t seem to fix it.

var ctx;
var canvas = document.getElementById("hotellCanvas");

const cities = [
    { x:360, y:210 },
    { x:450, y:125 },
    { x:550, y:150 },
    { x:283, y:85 },
    { x:160, y:150 }
];

const stars = new Image();
stars.src = "assets/Stars.png";

var mx = 0;
var my = 0;
var activeSkyscraperIndex = -1; // Initially, no active skyscraper.

function mouseMove(e) {
    var rect = e.target.getBoundingClientRect();
    mx = e.clientX - rect.left;
    my = e.clientY - rect.top;
}

//This function is called by the onmousemove event for the canvas element 
function mouseDown(event) {
    event.preventDefault();

    if (event.which == 1) {
        for (let i = 0; i < cities.length; i++) {
            if (
                mx > cities[i].x + 12 &&
                mx < cities[i].x + 55 &&
                my > cities[i].y + 0 &&
                my < cities[i].y + 85
            ) {
                activeSkyscraperIndex = i;
            }
        }
        redraw();
    }
}

function redraw() {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.save();
    ctx.scale(.90, .90);
    ctx.translate(80, 20);
    drawMap();
    ctx.restore();

    var v = 0;
    var x = 0;

    v = v + 0.025;
    x = Math.sin(v) * 0.015;

    for (let i = 0; i < cities.length; i++) {
        ctx.save();
        ctx.translate(cities[i].x, cities[i].y);
        ctx.translate(stars.x, stars.y);

        if (i === activeSkyscraperIndex) {
            ctx.scale(.25 + x, .25 + x);
            ctx.translate(0, -50 - x);
            console.log('i: ', i);
            console.log('activeSkyscraperIndex: ', activeSkyscraperIndex);
            console.log('City: ', cities[i]);
        } else {
            ctx.scale(0.25, 0.25);
        }

        drawSkyScraper();
        ctx.translate(100, -100);
        drawPixel();
        ctx.restore();
    }

    window.requestAnimationFrame(redraw);
}

canvas.addEventListener('mousedown', mouseDown);

function animate() {
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    redraw();
    window.requestAnimationFrame(animate);
}

function startcanvas() {
    var canvas = document.getElementById("hotellCanvas");
    ctx = canvas.getContext("2d");
    canvas.addEventListener('mousemove', mouseMove);
    redraw();
    animate();
}

The for / if – loop code inside of the function redraw, where i use console.log is where it shows the endless executing loop in the console, any ideas on how to fix this?

Console, after clicked element

Birt changing by script the number format in one column table

In a Birt report I’d like to change the number format depending on the data values.

I tried this in onRender of the table’s script to test how changing format programmaticaly :

var df = new Packages.java.text.DecimalFormat("#,###.000000");
df.format(row["tensionEcm1"]);

There is no effect on the column display. Any ideas?

Vue components in app no longer propogates state changes to computed methods after refactoring of my VUEX store

I refactored my Vuex store from using Promises, to using asyns/await style. After applying that change, somehow my computed methods are no longer “dynamic”.

Let me give an example.

    /// old approach
    getCurrentUser({commit}) {
      return new Promise((resolve, reject) => {
        usersService.current()
        .then(
            user => { 
                commit('setUserId', user.id)
                User.insert({data: user})
                resolve(user)
            },
            error => reject(error)
       )
      })

    /// new approach
    async getCurrentUser({ dispatch, commit }) {
      const response = await handleApiAction({
        dispatch,
        record: false,
        action: () => usersService.current(),
        modelClass: User,
      });
      return commit('setUserId', response.id)

The problem occurs in my c omponent, where I try to access the User ID, which is stored in a state variable state.current_user.id

  // code in my component that depends on above service API calls

  computed: {
    notifications() {
      return Notification.query()
        .where('target_type','User')
        .where('target_id', this.current_user_id)
        .orderBy('created_at', 'desc').get()
    },
    current_user_id() {
      return his.$store.state.users.current_user.id
    }

Somehow the Notifications never get loaded, as the computed method current_user_id doesn’t seem to return a value. When I inspect my Vue store (via Chrome plugin), I do see that the value gets properly set, only somehow the computed method isn’t informed when the update is received in the async/await scenario. Is there a way to overcome this?

How to validate text field with javascript in html? [closed]

I want to set up validation of the data received from the text field. I need to have restrictions on the length of the field and there is a mail check (so that the domain corresponds to one of the proposed ones)

There is my html file

<!DOCTYPE html>
<html>
<head>
    <title>Form with Text Fields</title>
</head>
<body>

    <h2>Participant Information</h2>
    <form>
        <label for="firstName">First Name:</label><br>
        <input type="text" id="firstName" name="firstName"><br><br>
        
        <label for="lastName">Last Name:</label><br>
        <input type="text" id="lastName" name="lastName"><br><br>
        
        <label for="age">Age:</label><br>
        <input type="text" id="age" name="age"><br><br>
        
        <label for="email">Email:</label><br>
        <input type="text" id="email" name="email"><br><br>
        
        <label for="phone">Phone:</label><br>
        <input type="text" id="phone" name="phone"><br><br>
        
        <label for="city">City:</label><br>
        <input type="text" id="city" name="city"><br><br>        
        
        <input type="submit" value="Submit">
    </form>

</body>

ASP.NET Core API: No data is received in Ajax get request

In my project, I add and list data with ajax. I add the data successfully with Ajax, I see the toastify notification but the data is not listed.

When I check it with the API, the data comes. There was no such problem when I first wrote the project, but now there is no listing, the same is true for other pages.

Controller.cs,

[HttpGet]
public async Task<IActionResult> GetExpenseByUser()
{
    var user = await _userManager.FindByNameAsync(User.Identity.Name);
    int id = user.Id;
    var client = _httpClientFactory.CreateClient();
    var responseMessage = await client.GetAsync($"https://localhost:7198/api/Expense/ListExpenseByUser?id={id}");
    if (responseMessage.IsSuccessStatusCode)
    {
        var jsonData = await responseMessage.Content.ReadAsStringAsync();
        var values = JsonConvert.DeserializeObject<List<ResultExpenseByUserDto>>(jsonData);
        return Json(values);
    }
    return View();
}

Index.cshtml,

<script>
    $(document).ready(function () {
        function listExpense() {
            $.ajax({
                type: "Get",
                url: "/Accounting/GetExpenseByUser",
                success: function (value) {
                    $("#tableExpense tbody").empty();
                    var tablerow;
                    $.each(value, (index, item) => {
                        tablerow = $("<tr/>");
                        tablerow.append(`<td><a class="fw-semibold text-primary">#${item.periodID}</a></td>`)
                        tablerow.append(`<td>${item.createUser}</td>`)
                        tablerow.append(`<td>${item.periodMonth}</td>`)
                        tablerow.append(`<td>${item.periodYear}</td>`)
                        switch (item.paymentStatus) {
                            case 9999:
                                tablerow.append(`<td><span class="badge bg-warning-transparent">Bekleniyor</span></td>`)
                                break;
                            case 9998:
                                tablerow.append(`<td><span class="badge bg-warning-transparent">Onay Sürecinde - Yönetici</span></td>`)
                                break;
                            case 1:
                                tablerow.append(`<td><span class="badge bg-warning-transparent">Ödeme Bekleniyor - Muhasebe</span></td>`)
                                break;
                            case 2:
                                tablerow.append(`<td><span class="badge bg-success-transparent">Ödeme Yapıldı</span></td>`)
                                break;
                            case 3:
                                tablerow.append(`<td><span class="badge bg-dark-transparent">Gecikmiş Ödeme</span></td>`)
                                break;
                            case 4:
                                tablerow.append(`<td><span class="badge bg-danger-transparent">İptal Edilen Ödeme</span></td>`)
                                break;
                        }
                        let formattedTotalAmount = parseFloat(item.totalAmount).toLocaleString('tr-TR', { minimumFractionDigits: 2 });
                        tablerow.append(`<td>₺${formattedTotalAmount}</td>`);
                        tablerow.append(`<td><a href="#" class="btn btn-primary-light btn-icon btn-sm"><i class="ri-eye-line"></i></a> <a href="/Accounting/ExpenseTransactions/${item.expenseID}" class="btn btn-primary-light btn-icon btn-sm"><i class="ri-send-plane-2-line"></i></a></td>`);
                        $("#tableExpense").append(tablerow);
                    });
                },
                error: function (xhr, status, error) {
                }
            });
        }

        $("#btnAddExpense").click(function () {
            $.ajax({
                type: "Post",
                url: "/Accounting/Index",
                success: function () {
                    listExpense();

                    Toastify({
                        text: 'Harcama Dönemi Oluşturuldu',
                        duration: 3000,
                        gravity: "top",
                        position: 'right',
                        backgroundColor: "#4CAF50",
                        stopOnFocus: true,
                    }).showToast();
                },
                error: function (xhr, status, error) {
                    var errorMessage = xhr.responseJSON ? xhr.responseJSON : "Bu Döneme Ait Kayıt Bulunmaktadır";
                    Toastify({
                        text: errorMessage,
                        duration: 3000,
                        gravity: "top",
                        position: 'right',
                        backgroundColor: "#f64e60",
                        stopOnFocus: true,
                    }).showToast();
                }
            });
        });
    });
</script>

There are no errors in the console.Everything seems successful.

I request your help.
Thanks.

Is there a difference between onerror in window and onerror in service worker?

I want to add logging via sentry to the service worker. I’m worried that the some site may already have its own sentry and my sentry will conflict with it. I want to add logging via sentry to the service worker. I’m worried that the site may already have its own sentry and my sentry will conflict with it.

I want to add logging via sentry to the service worker. I’m worried that the site may already have its own sentry and my sentry will conflict with it.