diff --git a/server/src/channels.rs b/server/src/channels.rs index f2cd7ad..5076e67 100644 --- a/server/src/channels.rs +++ b/server/src/channels.rs @@ -6,6 +6,7 @@ use diesel::{self, prelude::*}; use rocket_contrib::json::Json; use std::vec::Vec; use crate::models::{InsertableChannel, Channel, VOICE_CHANNEL, TEXT_CHANNEL}; +use crate::auth::{AuthResult, AuthErr, AuthKey}; use crate::{DBConn, schema, payload}; use crate::err::{self, DbError}; @@ -31,8 +32,8 @@ pub fn insert_new_channel(qname: String, perms: i32, lim: i32, ctype: i32, conn: } } -#[get("/voice")] -pub fn get_voice_channels(conn: DBConn) -> DbError>, err::DbResponse> { +#[get("/list/voice")] +pub fn get_voice_channels(conn: DBConn) -> AuthResult>, err::DbResponse> { use schema::channels::dsl::*; let result = channels.filter(type_.eq(VOICE_CHANNEL)).load(&conn.0); @@ -45,7 +46,7 @@ pub fn get_voice_channels(conn: DBConn) -> DbError>, err::DbRe } -#[get("/text")] +#[get("/list/text")] pub fn get_text_chanels(conn: DBConn) -> DbError>, err::DbResponse> { use schema::channels::dsl::*;