Tried to add MirageJS but failed
This commit is contained in:
parent
6d83c18036
commit
548dd0d022
8 changed files with 681 additions and 373 deletions
|
|
@ -1,5 +1,3 @@
|
|||
//! Handles all posts-related database operations.
|
||||
|
||||
use chrono::NaiveDate;
|
||||
use diesel::{insert_into, prelude::*, Insertable, PgConnection, Queryable};
|
||||
use uuid::Uuid;
|
||||
|
|
@ -9,7 +7,6 @@ use crate::{
|
|||
schema::{posts, posts::dsl::*},
|
||||
};
|
||||
|
||||
/// Represents a post contained within the database.
|
||||
#[derive(Queryable)]
|
||||
pub struct Post
|
||||
{
|
||||
|
|
@ -20,7 +17,6 @@ pub struct Post
|
|||
pub content: String,
|
||||
}
|
||||
|
||||
/// Represents a new post to be added to the database.
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "posts"]
|
||||
pub struct NewPost
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ pub struct Section
|
|||
/// A new section to be added into the database.
|
||||
#[derive(Deserialize, Insertable)]
|
||||
#[table_name = "sections"]
|
||||
// #[serde(rename_all = "camelCase")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct NewSection
|
||||
{
|
||||
title: String,
|
||||
|
|
|
|||
Reference in a new issue