use futures_util::{future::BoxFuture, FutureExt}; use giterated_models::{ repository::{Description, Repository}, settings::AnySetting, user::User, value::AnyValue, }; use giterated_stack::{AuthorizedUser, StackOperationState}; pub fn user_set_value( _object: User, _value_name: String, _value: AnyValue, _operation_state: &StackOperationState, ) -> BoxFuture<'static, Result<(), ()>> { todo!() } pub fn user_set_setting( _object: User, _value_name: String, _value: AnySetting, _operation_state: &StackOperationState, ) -> BoxFuture<'static, Result<(), ()>> { todo!() } pub fn repository_set_value( _object: Repository, _value_name: String, _value: AnyValue, _operation_state: &StackOperationState, ) -> BoxFuture<'static, Result<(), ()>> { todo!() } pub fn repository_set_setting( _object: Repository, _value_name: String, _value: AnySetting, _operation_state: &StackOperationState, ) -> BoxFuture<'static, Result<(), ()>> { todo!() } pub fn repository_set_description( _object: Repository, _description: Description, _user: AuthorizedUser, ) -> BoxFuture<'static, Result<(), ()>> { async { Ok(()) }.boxed() } // pub fn repository_set_default_branch( // object: Repository, // default_branch: DefaultBranch, // // Ensure user is authorized for this request // _user: AuthorizedUser, // backend: DatabaseBackend, // stack: Arc, // ) -> BoxFuture<'static, Result<(), ()>> { // async move { // stack.write_setting(&object, &default_branch).await.unwrap(); // let _set_value = ValueUpdate { // object: object.to_string(), // value_name: DefaultBranch::value_name().to_owned(), // value: unsafe { AnyValue::from_raw(serde_json::to_value(default_branch).unwrap()) }, // }; // // Submit value update back to the daemon // // state.value_update(set_value); // Ok(()) // } // .boxed() // }