mirror of
https://github.com/valitydev/party-client-erlang.git
synced 2024-11-06 02:35:20 +00:00
ED-190/deps: update dmt_client (#29)
* ED-190/deps: update dmt_client * ED-190/fix: Update to shortcut methods
This commit is contained in:
parent
a6471d4074
commit
f1bf192df6
@ -34,18 +34,14 @@ apply_domain_fixture() ->
|
||||
|
||||
-spec apply_domain_fixture([dmsl_domain_thrift:'DomainObject'()]) -> ok.
|
||||
apply_domain_fixture(Fixture) ->
|
||||
#'Snapshot'{version = Head} = dmt_client:checkout({head, #'Head'{}}),
|
||||
Commit = #'Commit'{ops = [{insert, #'InsertOp'{object = F}} || F <- Fixture]},
|
||||
%% logger:error("Fixture: ~p~nCommit: ~p", [Fixture, Commit]),
|
||||
_NextRevision = dmt_client:commit(Head, Commit),
|
||||
_NextRevision = dmt_client:insert(Fixture),
|
||||
ok.
|
||||
|
||||
-spec cleanup() -> ok.
|
||||
cleanup() ->
|
||||
#'Snapshot'{domain = Domain, version = Head} = dmt_client:checkout({head, #'Head'{}}),
|
||||
#'Snapshot'{domain = Domain, version = Head} = dmt_client:checkout(latest),
|
||||
Objects = maps:values(Domain),
|
||||
Commit = #'Commit'{ops = [{remove, #'RemoveOp'{object = O}} || O <- Objects]},
|
||||
_NextRevision = dmt_client:commit(Head, Commit),
|
||||
_NextRevision = dmt_client:remove(Head, Objects),
|
||||
ok.
|
||||
|
||||
-spec construct_domain_fixture() -> [dmsl_domain_thrift:'DomainObject'()].
|
||||
|
Loading…
Reference in New Issue
Block a user