mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-26 15:29:21 +00:00
Can check the availability of a virtual directory for a user
This commit is contained in:
parent
4e343041d4
commit
4cbf57d369
@ -95,6 +95,7 @@ pub fn get_routes() -> Vec<Route> {
|
||||
// Settings controller
|
||||
Route::post("/settings/get_general", Box::new(settings_controller::get_general)),
|
||||
Route::post("/settings/set_general", Box::new(settings_controller::set_general)),
|
||||
Route::post("/settings/check_user_directory_availability", Box::new(settings_controller::check_virtual_directory)),
|
||||
|
||||
// Friends controller
|
||||
Route::post("/friends/getList", Box::new(friends_controller::get_list)),
|
||||
|
@ -48,3 +48,11 @@ pub fn set_general(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
|
||||
r.success("Settings updated")
|
||||
}
|
||||
|
||||
/// Check the availability of a virtual directory
|
||||
pub fn check_virtual_directory(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
// We can do this check just by getting it, there is no need to store it in a variable
|
||||
r.post_checked_virtual_directory_opt("directory", r.user_id()?.id(), VirtualDirType::USER)?;
|
||||
|
||||
r.success("The directory is available!")
|
||||
}
|
Loading…
Reference in New Issue
Block a user