fix: Use incremental ID
This commit is contained in:
@@ -142,10 +142,16 @@ impl Calendar {
|
||||
/// Creates a new calendar with auto-generated ID
|
||||
///
|
||||
/// # Arguments
|
||||
/// * `id` - Optional ID for the calendar (use None for auto-generated ID)
|
||||
/// * `name` - Name of the calendar
|
||||
pub fn new(name: impl ToString) -> Self {
|
||||
pub fn new(id: Option<u32>, name: impl ToString) -> Self {
|
||||
let mut base_data = BaseModelData::new();
|
||||
if let Some(id) = id {
|
||||
base_data.update_id(id);
|
||||
}
|
||||
|
||||
Self {
|
||||
base_data: BaseModelData::new(),
|
||||
base_data,
|
||||
name: name.to_string(),
|
||||
description: None,
|
||||
events: Vec::new(),
|
||||
|
Reference in New Issue
Block a user