From 32a9fbe35ab59af35a7a77667f615b8910200111 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 25 May 2021 11:30:40 +0930 Subject: [PATCH] Refresh the model after updating --- src/Endpoint/Update.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Endpoint/Update.php b/src/Endpoint/Update.php index 88ca145..7445f49 100644 --- a/src/Endpoint/Update.php +++ b/src/Endpoint/Update.php @@ -58,7 +58,10 @@ class Update run_callbacks($schema->getListeners('updated'), [&$this->model, $context]); - return (new Show($this->api, $this->resource, $this->model)) + $adapter = $this->resource->getAdapter(); + $freshModel = $this->findResource($this->resource, $adapter->getId($this->model), $context); + + return (new Show($this->api, $this->resource, $freshModel)) ->handle($context); } }