diff --git a/docs/migration.sql b/docs/migration.sql index 3b3b89f..105f2e9 100644 --- a/docs/migration.sql +++ b/docs/migration.sql @@ -1,10 +1 @@ --- Create report table -CREATE TABLE `comunic_reports` ( - `id` INT NOT NULL AUTO_INCREMENT, - `user_id` INT NOT NULL, - `target_type` VARCHAR(25) NOT NULL, - `target_id` INT NOT NULL, - `time` INT NOT NULL, - `cause` VARCHAR(20) NOT NULL, - `comment` TEXT NULL, - PRIMARY KEY (`id`)); +-- Nothing yet \ No newline at end of file diff --git a/src/api_data/notification_api.rs b/src/api_data/notification_api.rs index 21eb6b7..526af64 100644 --- a/src/api_data/notification_api.rs +++ b/src/api_data/notification_api.rs @@ -40,7 +40,7 @@ impl NotificationAPI { } } - pub fn for_list(l: &Vec) -> Vec { + pub fn for_list(l: &[Notification]) -> Vec { l.iter().map(Self::new).collect() } } \ No newline at end of file diff --git a/src/api_data/posts_targets_api.rs b/src/api_data/posts_targets_api.rs index 96c7003..0f902d0 100644 --- a/src/api_data/posts_targets_api.rs +++ b/src/api_data/posts_targets_api.rs @@ -13,7 +13,7 @@ pub struct PostsTargets { } impl PostsTargets { - pub fn new(f: &Vec, g: &Vec) -> PostsTargets { + pub fn new(f: &[UserID], g: &[GroupID]) -> PostsTargets { PostsTargets { friends: f.iter().map(|f| f.id()).collect(), groups: g.iter().map(|f| f.id()).collect(), diff --git a/src/api_data/user_membership_api.rs b/src/api_data/user_membership_api.rs index bcd4d7d..f533aea 100644 --- a/src/api_data/user_membership_api.rs +++ b/src/api_data/user_membership_api.rs @@ -26,7 +26,7 @@ impl UserMembershipAPI { membership_type: TypeContainerAPI::new("group".to_string()), id: Some(group_id.id()), friend: None, - last_activity: Some(last_activity.clone()), + last_activity: Some(*last_activity), conv: None, }, @@ -48,7 +48,7 @@ impl UserMembershipAPI { } } - pub fn for_list(l: &Vec) -> Vec { + pub fn for_list(l: &[UserMembership]) -> Vec { l.iter().map(Self::new).collect() } } \ No newline at end of file