You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried GET and CREATE but PATCH, no matter which of the required values are sent, it will not update. It finishes the response and returns the current location entry, but no changes. I can do PATCH requests on other endpoints like Orders. Tried changing from staff to all. Seems like something in the Transformer or the LocationRequest -> it's different from other API classes as it points to admin/requests/locationrequest.php, although it doesn't seem like that should matter as it has all the required data. Mostly was trying to use this so that I can disable or enable locations programatically.
Sample JSON I used that got a 200 response with the old unchanged data:
I'll come back to this, but wanted to document for myself as well. Also tried using 0 and 1 for location_status.
What did you expect to happen?
Expect that since a 200 response is returned, that the value would change if there was a new item in the JSON body of the PATCH
this is going to /api/locations/1
Version
3.x
What browser are you seeing the problem on?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Was doing testing and found that in ArtifactRepository.php, ~line 115, using this code, I was just testing if I could set the location_status. And I could, so something in $this->setModelAttributes($model, $attributes) or $this->setCustomerAwareAttributes($model) is not setting modelsToSave correctly, it's just saving it with whatever is in the DB so it ignores the PATCH body data. But you can see $attributes does hold the PATCH data.
$this->setModelAttributes($model, $attributes);
$this->setCustomerAwareAttributes($model);
if (!is_null($this->modelsToSave) && !empty($this->modelsToSave)) {
if (isset($this->modelsToSave[0]->location_status) && isset($attributes['location_status'])) {
$this->modelsToSave[0]->location_status = $attributes['location_status'];
}
}
What happened?
Tried GET and CREATE but PATCH, no matter which of the required values are sent, it will not update. It finishes the response and returns the current location entry, but no changes. I can do PATCH requests on other endpoints like Orders. Tried changing from staff to all. Seems like something in the Transformer or the LocationRequest -> it's different from other API classes as it points to admin/requests/locationrequest.php, although it doesn't seem like that should matter as it has all the required data. Mostly was trying to use this so that I can disable or enable locations programatically.
Sample JSON I used that got a 200 response with the old unchanged data:
I'll come back to this, but wanted to document for myself as well. Also tried using 0 and 1 for location_status.
What did you expect to happen?
Expect that since a 200 response is returned, that the value would change if there was a new item in the JSON body of the PATCH
this is going to /api/locations/1
Version
3.x
What browser are you seeing the problem on?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: