recipes/api/src/rest/ingredient/types.rs

20 lines
377 B
Rust

use crate::domain;
use crate::rest::Lang;
#[derive(Debug, Serialize)]
pub struct Ingredient {
pub key: String,
pub lang: Lang,
pub name: String,
}
impl From<domain::Ingredient> for Ingredient {
fn from(app: domain::Ingredient) -> Self {
Self {
key: app.key,
lang: app.lang.into(),
name: app.name,
}
}
}