Add Favorite GET, and POST endpoints
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::database::schema::users;
|
||||
use crate::database::schema::{favorites, users};
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Insertable)]
|
||||
@@ -15,3 +15,17 @@ pub struct User {
|
||||
#[serde(skip_serializing)]
|
||||
pub password: String,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "favorites"]
|
||||
pub struct InsertFavorite<'a> {
|
||||
pub userid: &'a i32,
|
||||
pub path: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Queryable, Clone, Debug)]
|
||||
pub struct Favorite {
|
||||
pub id: i32,
|
||||
pub userid: i32,
|
||||
pub path: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user