refactor: Remove command 'nextcloud card list'
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 2m0s
Test / build (map[name:stable]) (push) Successful in 1m51s
Release Please / Release-plz (push) Failing after 14s

Replaced by 'nextcloud stack get'.
This commit is contained in:
Paul Campbell 2024-12-17 07:00:36 +00:00
parent cef45362de
commit 0047f5d0ef
2 changed files with 1 additions and 29 deletions

View file

@ -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 deck get - includes list of boards
- [x] nextcloud board get - includes list of stacks - [x] nextcloud board get - includes list of stacks
- [x] nextcloud stack get - includes list of cards - [x] nextcloud stack get - includes list of cards
- [ ] nextcloud card get - shows card title
- [ ] nextcloud card create - [ ] nextcloud card create
- [ ] nextcloud card add-label - [ ] nextcloud card add-label
- [ ] nextcloud card add-attachment - [ ] nextcloud card add-attachment

View file

@ -10,11 +10,6 @@ use crate::{
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
pub enum NextcloudCardCommand { pub enum NextcloudCardCommand {
List {
#[clap(long, action = clap::ArgAction::SetTrue)]
dump: bool,
stack_id: i64,
},
Get { Get {
#[clap(long, action = clap::ArgAction::SetTrue)] #[clap(long, action = clap::ArgAction::SetTrue)]
dump: bool, dump: bool,
@ -43,9 +38,6 @@ pub enum NextcloudCardCommand {
impl Execute for NextcloudCardCommand { impl Execute for NextcloudCardCommand {
async fn execute(&self, ctx: &FullCtx) -> color_eyre::Result<()> { async fn execute(&self, ctx: &FullCtx) -> color_eyre::Result<()> {
match self { match self {
Self::List { dump, stack_id } => {
list(ctx, *dump, NextcloudStackId::from(*stack_id)).await
}
Self::Get { Self::Get {
dump, dump,
stack_id, 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( pub(crate) async fn get(
ctx: &FullCtx, ctx: &FullCtx,
dump: bool, dump: bool,