refactor: Remove command 'nextcloud card list'
Replaced by 'nextcloud stack get'.
This commit is contained in:
parent
cef45362de
commit
0047f5d0ef
2 changed files with 1 additions and 29 deletions
|
@ -77,6 +77,7 @@ As part of building the import server, the following commands exercise each oper
|
|||
- [x] nextcloud deck get - includes list of boards
|
||||
- [x] nextcloud board get - includes list of stacks
|
||||
- [x] nextcloud stack get - includes list of cards
|
||||
- [ ] nextcloud card get - shows card title
|
||||
- [ ] nextcloud card create
|
||||
- [ ] nextcloud card add-label
|
||||
- [ ] nextcloud card add-attachment
|
|
@ -10,11 +10,6 @@ use crate::{
|
|||
|
||||
#[derive(Parser, Debug)]
|
||||
pub enum NextcloudCardCommand {
|
||||
List {
|
||||
#[clap(long, action = clap::ArgAction::SetTrue)]
|
||||
dump: bool,
|
||||
stack_id: i64,
|
||||
},
|
||||
Get {
|
||||
#[clap(long, action = clap::ArgAction::SetTrue)]
|
||||
dump: bool,
|
||||
|
@ -43,9 +38,6 @@ pub enum NextcloudCardCommand {
|
|||
impl Execute for NextcloudCardCommand {
|
||||
async fn execute(&self, ctx: &FullCtx) -> color_eyre::Result<()> {
|
||||
match self {
|
||||
Self::List { dump, stack_id } => {
|
||||
list(ctx, *dump, NextcloudStackId::from(*stack_id)).await
|
||||
}
|
||||
Self::Get {
|
||||
dump,
|
||||
stack_id,
|
||||
|
@ -97,27 +89,6 @@ impl Execute for NextcloudCardCommand {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn list(
|
||||
ctx: &FullCtx,
|
||||
dump: bool,
|
||||
stack_id: NextcloudStackId,
|
||||
) -> color_eyre::Result<()> {
|
||||
let api_result = ctx
|
||||
.deck_client()
|
||||
.get_stack(ctx.cfg.nextcloud.board_id, stack_id)
|
||||
.await;
|
||||
if dump {
|
||||
p!(ctx.prt, "{}", api_result.text);
|
||||
} else {
|
||||
let mut cards = api_result.result?.cards;
|
||||
cards.sort_by_key(|card| card.title.clone());
|
||||
cards
|
||||
.iter()
|
||||
.for_each(|card| p!(ctx.prt, "{}:{}", card.id, card.title));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn get(
|
||||
ctx: &FullCtx,
|
||||
dump: bool,
|
||||
|
|
Loading…
Reference in a new issue