1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-30 01:06:27 +00:00

Can check the availability of a virtual directory for a user

This commit is contained in:
Pierre HUBERT 2020-07-14 13:12:16 +02:00
parent 4e343041d4
commit 4cbf57d369
2 changed files with 9 additions and 0 deletions

View File

@ -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)),

View File

@ -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!")
}