diff --git a/src/api_data/account_export_api.rs b/src/api_data/account_export_api.rs index 0efe903..23d67f7 100644 --- a/src/api_data/account_export_api.rs +++ b/src/api_data/account_export_api.rs @@ -4,6 +4,7 @@ use serde::Serialize; use crate::api_data::comment_api::CommentAPI; +use crate::api_data::movie_api::MovieAPI; use crate::api_data::post_api::PostAPI; use crate::api_data::survey_response_api::SurveyResponseAPI; use crate::api_data::user_info::APIUserInfo; @@ -20,6 +21,7 @@ pub struct AccountExportAPI { comments: Vec, likes: Vec, survey_responses: Vec, + movies: Vec, } impl AccountExportAPI { @@ -32,6 +34,7 @@ impl AccountExportAPI { comments: CommentAPI::for_list(&export.comments, &curr_user_id.as_option())?, likes: UserLikeAPI::for_list(&export.likes), survey_responses: SurveyResponseAPI::for_list(&export.survey_responses), + movies: MovieAPI::for_list(&export.movies), }; Ok(export) diff --git a/src/data/account_export.rs b/src/data/account_export.rs index 3da6e08..733cded 100644 --- a/src/data/account_export.rs +++ b/src/data/account_export.rs @@ -7,6 +7,7 @@ use crate::data::post::Post; use crate::data::survey_response::SurveyResponse; use crate::data::user::User; use crate::data::user_like::UserLike; +use crate::data::movie::Movie; pub struct AccountExport { pub user: User, @@ -14,4 +15,5 @@ pub struct AccountExport { pub comments: Vec, pub likes: Vec, pub survey_responses: Vec, + pub movies: Vec, } \ No newline at end of file diff --git a/src/helpers/account_helper.rs b/src/helpers/account_helper.rs index fc042f3..fa9a8cb 100644 --- a/src/helpers/account_helper.rs +++ b/src/helpers/account_helper.rs @@ -6,7 +6,7 @@ use crate::data::error::{ExecError, ResultBoxError}; use crate::data::new_account::NewAccount; use crate::data::user::UserID; use crate::data::user_token::UserAccessToken; -use crate::helpers::{comments_helper, database, likes_helper, posts_helper, survey_helper, user_helper}; +use crate::helpers::{comments_helper, database, likes_helper, posts_helper, survey_helper, user_helper, movies_helper}; use crate::helpers::database::{DeleteQuery, InsertQuery, QueryInfo}; use crate::utils::crypt_utils::{crypt_pass, rand_str}; use crate::utils::date_utils::{mysql_date, time}; @@ -199,6 +199,9 @@ pub fn export(user_id: &UserID) -> ResultBoxError { comments: comments_helper::export_all_user(user_id)?, likes: likes_helper::export_all_user(user_id)?, survey_responses: survey_helper::export_all_user_responses(user_id)?, + movies: movies_helper::get_list_user(user_id)?, + + //TODO : add other fields }; Ok(data)