Fixed issue with User database responses:

Added insertable to ensure compilation even though we dont use that trait
This commit is contained in:
shockrah 2020-05-06 22:18:51 -07:00
parent 81e6fd0a13
commit 22a1fd1730

View File

@ -7,19 +7,22 @@ pub struct Invite {
pub uses: i32, pub uses: i32,
} }
#[derive(Serialize, Deserialize, Queryable, Debug)]
#[derive(Insertable)]
#[table_name = "users"] #[table_name = "users"]
pub struct User { pub struct InsertableUser {
pub userid: u64, pub name: String,
pub username: String,
pub secret: String, pub secret: String,
pub date: u64, pub date: u64,
pub status: i32, pub status: i32,
} }
#[derive(Insertable) // NOTE: Insertable is the only rls stop complaining at us about `table_name` not being found in scope
// its dumb but its how we're going to compile this, with some dead code
#[derive(Insertable, Serialize, Deserialize, Queryable, Debug)]
#[table_name = "users"] #[table_name = "users"]
pub struct InsertableUser { pub struct User {
pub id: u64,
pub name: String, pub name: String,
pub secret: String, pub secret: String,
pub date: u64, pub date: u64,