Commit 97397721 authored by Paweł Wegner's avatar Paweł Wegner
Browse files

DeleteItemRequest: refactored.

parent 0025552c
......@@ -30,19 +30,19 @@ namespace cloudstorage {
DeleteItemRequest::DeleteItemRequest(std::shared_ptr<CloudProvider> p,
IItem::Pointer item,
DeleteItemCallback callback)
: Request(p), item_(item), callback_(callback) {
set([this](Request::Ptr request) {
: Request(p) {
set([=](Request::Ptr request) {
auto output = std::make_shared<std::stringstream>();
sendRequest(
[this](util::Output stream) {
return provider()->deleteItemRequest(*item_, *stream);
[=](util::Output stream) {
return provider()->deleteItemRequest(*item, *stream);
},
[=](EitherError<util::Output> e) {
if (e.left()) {
callback_(e.left());
callback(e.left());
request->done(e.left());
} else {
callback_(nullptr);
callback(nullptr);
request->done(nullptr);
}
},
......
......@@ -33,10 +33,6 @@ class DeleteItemRequest : public Request<EitherError<void>> {
DeleteItemRequest(std::shared_ptr<CloudProvider>, IItem::Pointer item,
DeleteItemCallback);
~DeleteItemRequest();
private:
IItem::Pointer item_;
DeleteItemCallback callback_;
};
} // namespace cloudstorage
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment