Some route boilerplate for posts
This commit is contained in:
parent
769d7a32de
commit
f2a0401601
4 changed files with 30 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ pub mod sections;
|
|||
pub mod tokens;
|
||||
pub mod users;
|
||||
|
||||
pub use posts::{NewPost, PatchPost, Post};
|
||||
pub use sections::{NewSection, Section};
|
||||
pub use tokens::{NewRefreshToken, RefreshToken};
|
||||
pub use users::{NewUser, User};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use chrono::NaiveDate;
|
||||
use diesel::{insert_into, prelude::*, Insertable, PgConnection, Queryable};
|
||||
use serde::Deserialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::{
|
||||
|
|
@ -8,7 +8,7 @@ use crate::{
|
|||
schema::{posts, posts::dsl::*},
|
||||
};
|
||||
|
||||
#[derive(Queryable)]
|
||||
#[derive(Queryable, Serialize)]
|
||||
pub struct Post
|
||||
{
|
||||
pub id: Uuid,
|
||||
|
|
|
|||
Reference in a new issue