Back4App: Can read/retrieve rows but can't update/modify them

71 Views Asked by At

I know I am probably blind to something here, I am still new to learning all this. I am trying to modify a value in an object. The object is changing the way I want it by checking console.log(user), but for some reason, when the code gets to user.save(), it just returns this:

Error

async function healUser() {
  try {
    const customId = localStorage.getItem('Custom-User-ID');
    const query = new Parse.Query(Parse.User);
    query.equalTo("customId", customId);

    const user = await query.first();
    user.get("stats").health = user.get("stats").maxHealth;

    console.log(user)

    await user.save()
      .then((healedUser) => {
        healAlert();
      })
      .catch((error) => {
        console.error("Error: ", error);
      });

  } 
  catch (error) {
    console.error(error);
    // Handle any errors that occurred during healing process
  }
}

The code used to work for a good while, but suddenly I started getting this error. every other JS file that has the .save() returns a similar error.

I would have guessed I reached my limit on the Back4App requests, but I am just barely halfway through it.

I tried:

  • Comparing the object column names and values between the code and db
  • Changing the parse script header in my HTML to different versions
  • Clearing all browsing data and restarting Chrome/Opera/Firefox (tried live server in all 3)
  • Checking the back4app logs (Parse error: Cannot modify user 0dvbwwVi6h.)
  • Making a new back4app account just to test if it's an account/keys issue
  • Looking for a similar question/issue online
0

There are 0 best solutions below