refactor(trello): pin down parameter types for create_card
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 2m11s
Test / build (map[name:stable]) (push) Successful in 2m14s
Release Please / Release-plz (push) Failing after 20s

This commit is contained in:
Paul Campbell 2024-12-19 09:04:23 +00:00
parent 8f3035fccc
commit ad662cf422
2 changed files with 9 additions and 5 deletions

View file

@ -3,6 +3,7 @@ use std::path::PathBuf;
use clap::Parser; use clap::Parser;
use crate::nextcloud::model::{NextcloudCardDescription, NextcloudCardTitle};
use crate::{execute::Execute, p, FullCtx}; use crate::{execute::Execute, p, FullCtx};
#[derive(Parser, Debug)] #[derive(Parser, Debug)]
@ -82,8 +83,11 @@ impl Execute for NextcloudCardCommand {
.create_card( .create_card(
(*board_id).into(), (*board_id).into(),
(*stack_id).into(), (*stack_id).into(),
title, &NextcloudCardTitle::new(title),
description.as_deref(), description
.as_ref()
.map(NextcloudCardDescription::new)
.as_ref(),
) )
.await; .await;
if *dump { if *dump {

View file

@ -8,7 +8,7 @@ use reqwest::multipart;
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
use serde_json::json; use serde_json::json;
use crate::nextcloud::model::NextcloudStackTitle; use crate::nextcloud::model::{NextcloudCardDescription, NextcloudCardTitle, NextcloudStackTitle};
use crate::{ use crate::{
api_result::APIResult, api_result::APIResult,
f, f,
@ -162,8 +162,8 @@ impl<'ctx> DeckClient<'ctx> {
&self, &self,
board_id: NextcloudBoardId, board_id: NextcloudBoardId,
stack_id: NextcloudStackId, stack_id: NextcloudStackId,
title: &str, title: &NextcloudCardTitle,
description: Option<&str>, description: Option<&NextcloudCardDescription>,
) -> APIResult<Card> { ) -> APIResult<Card> {
let mut body = json!({ let mut body = json!({
"title": title, "title": title,