Cleanup, working on getting play to work
This commit is contained in:
@@ -8,8 +8,7 @@ use crate::db::{schema::guilds, connection};
|
||||
#[diesel(table_name = guilds)]
|
||||
pub struct QueryGuild {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub volume: f32
|
||||
pub volume: f64
|
||||
}
|
||||
|
||||
impl QueryGuild {
|
||||
@@ -24,8 +23,7 @@ impl QueryGuild {
|
||||
#[diesel(table_name = guilds)]
|
||||
pub struct InsertGuild {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub volume: f32
|
||||
pub volume: f64
|
||||
}
|
||||
|
||||
impl InsertGuild {
|
||||
@@ -35,7 +33,7 @@ impl InsertGuild {
|
||||
Ok(guild)
|
||||
}
|
||||
|
||||
pub fn update_audio(id: i64, volume: f32) -> Result<QueryGuild, ServiceError> {
|
||||
pub fn update_audio(id: i64, volume: f64) -> Result<QueryGuild, ServiceError> {
|
||||
let mut conn = connection()?;
|
||||
let guild = diesel::update(guilds::table.filter(guilds::id.eq(id))).set(guilds::volume.eq(volume)).get_result(&mut conn)?;
|
||||
Ok(guild)
|
||||
|
||||
@@ -34,7 +34,6 @@ diesel::table! {
|
||||
diesel::table! {
|
||||
guilds (id) {
|
||||
id -> BigInt,
|
||||
name -> Text,
|
||||
volume -> Float,
|
||||
volume -> Float8,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user