trello-to-deck/src/nextcloud/stack.rs
Paul Campbell 327e33a7e3
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 2m51s
Test / build (map[name:stable]) (push) Successful in 6m36s
Release Please / Release-plz (push) Failing after 16s
feat(nextcloud): add basics of nextcloud config model client
2024-12-13 07:30:36 +00:00

19 lines
530 B
Rust

//
use crate::{p, FullCtx};
use super::DeckClient;
pub async fn list(ctx: FullCtx, dump: bool) -> color_eyre::Result<()> {
let dc = DeckClient::new(&ctx.cfg.nextcloud, ctx.net);
let apiresult = dc.get_stacks(ctx.cfg.nextcloud.board_id()).await;
if dump {
p!("{}", apiresult.text);
} else {
let mut stacks = apiresult.result?;
stacks.sort_by_key(|stack| stack.order);
stacks
.iter()
.for_each(|stack| p!("{}:{}", stack.id, stack.title));
}
Ok(())
}