Skip to content

fix-upsert-validation

Compare
Choose a tag to compare
@macropay-solutions macropay-solutions released this 22 May 13:44
· 130 commits to production since this release

This fix will handle properly only the dirty properties on update and will not validate primary keys or other fields that have validations with unique in table, that are in the body of the request for create(upsert) if model not found. On create (including upsert) all request payload will be subjected to validation.

Note:

Until now, the external update, delete or create were forbidden by throwing an exception in the service.
From now on there will be these properties in the controller that need to be extended:

protected bool $forbidCreate = false;
protected bool $forbidGet = false;
protected bool $forbidList = false;
protected bool $forbidUpdate = false;
protected bool $forbidDelete = true;

Also now BaseResourceService class will have a working delete function instead of the old version when it threw exception with Forbidden message.