diff --git a/src/controllers/AccountController.ts b/src/controllers/AccountController.ts index 8672e27..588fc4e 100644 --- a/src/controllers/AccountController.ts +++ b/src/controllers/AccountController.ts @@ -10,6 +10,7 @@ import { PostsController } from "./PostsController"; import { CommentsController } from "./CommentsController"; import { LikesController } from "./LikesController"; import { SurveyController } from "./SurveyController"; +import { MoviesController } from "./MoviesController"; /** * Account controller @@ -244,7 +245,10 @@ export class AccountController { likes: data.likes.map(LikesController.UserLikeToAPI), // Responses to surveys - survey_responses: data.surveyResponses.map(SurveyController.SurveyResponseToAPI) + survey_responses: data.surveyResponses.map(SurveyController.SurveyResponseToAPI), + + // User movies + movies: data.movies.map(MoviesController.MovieToAPI), }; diff --git a/src/entities/AccountExport.ts b/src/entities/AccountExport.ts index 45c0a50..cbd917c 100644 --- a/src/entities/AccountExport.ts +++ b/src/entities/AccountExport.ts @@ -9,6 +9,7 @@ import { Post } from "./Post"; import { Comment } from "./Comment"; import { UserLike } from "./UserLike"; import { SurveyResponse } from "./SurveyResponse"; +import { Movie } from "./Movies"; export interface AccountExportBuilder { userID: number; @@ -17,6 +18,7 @@ export interface AccountExportBuilder { comments: Comment[]; likes: UserLike[]; surveyResponses: SurveyResponse[]; + movies: Movie[]; } export class AccountExport implements AccountExportBuilder { @@ -26,6 +28,7 @@ export class AccountExport implements AccountExportBuilder { comments: Comment[]; likes: UserLike[]; surveyResponses: SurveyResponse[]; + movies: Movie[]; public constructor(info: AccountExportBuilder) { for (const key in info) { diff --git a/src/helpers/AccountHelper.ts b/src/helpers/AccountHelper.ts index e96a0d4..af4faf5 100644 --- a/src/helpers/AccountHelper.ts +++ b/src/helpers/AccountHelper.ts @@ -11,6 +11,7 @@ import { PostsHelper } from "./PostsHelper"; import { CommentsHelper } from "./CommentsHelper"; import { LikesHelper } from "./LikesHelper"; import { SurveyHelper } from "./SurveyHelper"; +import { MoviesHelper } from "./MoviesHelper"; /** * Account helper @@ -401,7 +402,10 @@ export class AccountHelper { likes: await LikesHelper.ExportAllUser(userID), // Export all responses of user to surveys - surveyResponses: await SurveyHelper.ExportAllUserResponses(userID) + surveyResponses: await SurveyHelper.ExportAllUserResponses(userID), + + // User movies + movies: await MoviesHelper.GetListUser(userID), })