mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-27 09:40:33 +00:00
* Adding typescript generation for API. Fixes #2824 * Try to fix Ltree issue 1. * Forgot a few types. * Fixing api tests. * Removing url_serde line. * Manually deriving TS for some types.
30 lines
960 B
Rust
30 lines
960 B
Rust
use crate::newtypes::CustomEmojiId;
|
|
#[cfg(feature = "full")]
|
|
use crate::schema::custom_emoji_keyword;
|
|
use serde::{Deserialize, Serialize};
|
|
#[cfg(feature = "full")]
|
|
use ts_rs::TS;
|
|
use typed_builder::TypedBuilder;
|
|
|
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
|
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji_keyword))]
|
|
#[cfg_attr(
|
|
feature = "full",
|
|
diesel(belongs_to(crate::source::custom_emoji::CustomEmoji))
|
|
)]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct CustomEmojiKeyword {
|
|
pub id: i32,
|
|
pub custom_emoji_id: CustomEmojiId,
|
|
pub keyword: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, TypedBuilder)]
|
|
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
|
|
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji_keyword))]
|
|
pub struct CustomEmojiKeywordInsertForm {
|
|
pub custom_emoji_id: CustomEmojiId,
|
|
pub keyword: String,
|
|
}
|