We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, we can deactivate unitOfWork for a call on the client :
unitOfWork
sdk.getRepository('foo') .withUnitOfWork(false) .findAll()
We voluntarily throw an exception on create, update and delete call to prevent this:
create
update
delete
sdk.getRepository('foo') .withUnitOfWork(false) .create(someEntity) // this will throw an error
We made this decision as we are not quite sure what to do in this case. Feel free to add a comment to discuss this case in this issue.
The text was updated successfully, but these errors were encountered:
Upgrading this issue with latest thoughts:
We might want to deactivate the unitOfWork when we don't care about the result of the create, update or delete method.
Imagine a call that does fetch a item:
const item = await repository.find(1, { fields: '@id,name,type' });
later, we do have a modal that allow to change the name, but we don't care about the return
await repository.update(item.set('name', 'new name'), { fields: '@id' });
The unitOfWork will register the data with only the @id.
@id
If later call a "type changer":
await repository.update(item.set('type', 'new type'), { fields: '@id' });
The getDirtyData will return that only the @id is known, and then send a call with:
getDirtyData
{ name: 'new name', type: 'new type', }
We might want to disable the unit of work when "updating", as we do disable it for find method (a put is "just" a get that change some data before).
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Currently, we can deactivate
unitOfWork
for a call on the client :We voluntarily throw an exception on
create
,update
anddelete
call to prevent this:We made this decision as we are not quite sure what to do in this case. Feel free to add a comment to discuss this case in this issue.
The text was updated successfully, but these errors were encountered: