fusio icon indicating copy to clipboard operation
fusio copied to clipboard

Entry not available on Patch

Open ratsey opened this issue 3 years ago • 1 comments

When a PATCH call is made against an existing record where there is no change, an error is returned:

Entry not available in /.../vendor/fusio/adapter-sql/src/Action/SqlUpdate.php on line 61

Updating a record with no change should be a valid operation.

ratsey avatar Jun 12 '22 00:06 ratsey

Hi Ratsey, yes we use the affected rows return to determine whether a record was updated, so we dont need to make an separate query to check whether the row exists. But your case is indeed valid, if you send a request to an existing record which does not modify the row it should not return a 404. I have just created a PR and adjusted the actions a little bit to only return a 404 in case a row does not exist s. https://github.com/apioo/fusio-adapter-sql/pull/4/files

chriskapp avatar Jun 12 '22 09:06 chriskapp