diff options
author | desperateCoder <echotodevnull@gmail.com> | 2020-07-25 15:18:06 +0300 |
---|---|---|
committer | desperateCoder <echotodevnull@gmail.com> | 2020-07-25 15:18:06 +0300 |
commit | 0868f6d56aee63a8e91f93b665eadc16c5517cc7 (patch) | |
tree | 003e91776f5bffc2ef85fbefc2ca074687e8d501 /app/src | |
parent | a44e13cc26a0b5f3ea8278708d3527d8e8e87731 (diff) |
#611 new updateStack method
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java index c804b6851..3222fec4b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java @@ -876,11 +876,14 @@ public class SyncManager { } @AnyThread - public WrappedLiveData<Void> updateStackTitle(long accountId, long localStackId, @NonNull String newTitle) { - WrappedLiveData<Void> liveData = new WrappedLiveData<>(); + public WrappedLiveData<FullStack> updateStackTitle(long localStackId, @NonNull String newTitle) { + WrappedLiveData<FullStack> liveData = new WrappedLiveData<>(); doAsync(() -> { - // TODO implement, replaces #updateStack(@NonNull FullStack stack) - liveData.postError(new UnsupportedOperationException("Not yet implemented.")); + FullStack stack = dataBaseAdapter.getFullStackByLocalIdDirectly(localStackId); + FullBoard fullBoard = dataBaseAdapter.getFullBoardByLocalIdDirectly(stack.getAccountId(), stack.getStack().getBoardId()); + Account account = dataBaseAdapter.getAccountByIdDirectly(stack.getAccountId()); + stack.getStack().setTitle(newTitle); + updateStack(account, fullBoard, stack, liveData); }); return liveData; } |