feat: Add delete button to book editing keyboard
This commit is contained in:
@@ -183,15 +183,25 @@ public class KeyboardHelper {
|
||||
.callbackData("BOOK_EDIT_DATE")
|
||||
.build()
|
||||
);
|
||||
// navRow.add(
|
||||
// InlineKeyboardButton.builder()
|
||||
// .text("Отмена ❌")
|
||||
// .callbackData("BOOK_EDIT_CANCEL")
|
||||
// .build()
|
||||
// );
|
||||
|
||||
rows.add(navRow);
|
||||
|
||||
// Новая строка с кнопкой удаления
|
||||
InlineKeyboardRow actionRow = new InlineKeyboardRow();
|
||||
actionRow.add(
|
||||
InlineKeyboardButton.builder()
|
||||
.text("Удалить книгу \uD83D\uDDD1️")
|
||||
.callbackData("BOOK_DELETE")
|
||||
.build()
|
||||
);
|
||||
actionRow.add(
|
||||
InlineKeyboardButton.builder()
|
||||
.text("Отмена ❌")
|
||||
.callbackData("BOOK_EDIT_CANCEL")
|
||||
.build()
|
||||
);
|
||||
rows.add(actionRow);
|
||||
|
||||
return new InlineKeyboardMarkup(rows);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class BookEditingServiceImpl implements BookEditingService {
|
||||
book.ifPresentOrElse(
|
||||
b -> {
|
||||
log.info("Found book with id {}", bookId);
|
||||
telegramClientService.sendMessage(user, "Выберите поле для редактирования:", getEditOptions(user));
|
||||
telegramClientService.sendMessage(user, "Выберите поле для редактирования или удалите книгу:", getEditOptions(user));
|
||||
},
|
||||
() -> telegramClientService.sendMessage(user, Constants.ERROR_BOOK_NOT_FOUND)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user