MagisterJS icon indicating copy to clipboard operation
MagisterJS copied to clipboard

[Appointment].saveChanges() does not take effect

Open wipeautcrafter opened this issue 6 years ago • 6 comments

const toggleDone = async (appointment) => {
  appointment.isDone = !appointment.isDone;
  await appointment.saveChanges();
};

This simple function does nothing more than toggling the isDone property. Sadly, when running this, it fails to take effect...

Am I doing something wrong, or is this a legitimate issue? Does this work for you guys?

wipeautcrafter avatar Jun 10 '19 09:06 wipeautcrafter

Is it possible that it is not possible for you to update that property? If you go to Magister, are you able to toggle it there?

jvdoorn avatar Jun 11 '19 10:06 jvdoorn

afbeelding

When doing the exact same thing in Magister itself, it works just fine... Perhaps there is something wrong with the request? Does this work for you?

EDIT: It seems like the request you make from Magister.JS is missing the Bijlagen, TaakAangemaaktOp en TaakGewijzigdOp properties... That should not matter though, I think?

wipeautcrafter avatar Jun 12 '19 08:06 wipeautcrafter

Sadly I don't really have access to a Magister account anymore (finished school... that is assuming I passed my exams which I'll find out today) so I can't test it for you.

Regarding your edit, it might make a difference, I'm not sure how they validate the requests. You could try adding the fields but I'm not sure where they should be added (I'd have to take a look at the code again).

jvdoorn avatar Jun 12 '19 09:06 jvdoorn

@jvdoorn I can send you my credentials for testing purposes if you want to continue working on the project. More importantly, did you pass?

LevitatingBusinessMan avatar Jun 19 '19 21:06 LevitatingBusinessMan

I did pass 😃, I sent you an e-mail regarding the credentials 😉

jvdoorn avatar Jun 20 '19 09:06 jvdoorn

I have looked into this issue recently and I am 99% sure it has to do with the toMagister method. It is missing crucial fields which might be why Magister is denying the request. When I have time I will update the fields and make a pull request.

wipeautcrafter avatar Jan 11 '20 13:01 wipeautcrafter