mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-21 21:09:22 +00:00
Export the list of conversations
This commit is contained in:
parent
58877e0100
commit
653b066a3a
@ -252,7 +252,11 @@ export class AccountController {
|
||||
movies: data.movies.map(MoviesController.MovieToAPI),
|
||||
|
||||
// Conversations messages
|
||||
all_conversation_messages: data.conversationMessages.map(ConversationsController.ConversationMessageToAPI)
|
||||
all_conversation_messages: data.conversationMessages.map(ConversationsController.ConversationMessageToAPI),
|
||||
|
||||
// Conversations list
|
||||
conversations_list: data.conversations.map(ConversationsController.ConversationToAPI),
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -377,7 +377,7 @@ export class ConversationsController {
|
||||
*
|
||||
* @param c
|
||||
*/
|
||||
private static ConversationToAPI(c : Conversation) : any {
|
||||
public static ConversationToAPI(c : Conversation) : any {
|
||||
return {
|
||||
ID: c.id,
|
||||
ID_owner: c.ownerID,
|
||||
|
@ -11,6 +11,7 @@ import { UserLike } from "./UserLike";
|
||||
import { SurveyResponse } from "./SurveyResponse";
|
||||
import { Movie } from "./Movie";
|
||||
import { ConversationMessage } from "./ConversationMessage";
|
||||
import { Conversation } from "./Conversation";
|
||||
|
||||
export interface AccountExportBuilder {
|
||||
userID: number;
|
||||
@ -21,6 +22,7 @@ export interface AccountExportBuilder {
|
||||
surveyResponses: SurveyResponse[];
|
||||
movies: Movie[];
|
||||
conversationMessages: ConversationMessage[];
|
||||
conversations: Conversation[];
|
||||
}
|
||||
|
||||
export class AccountExport implements AccountExportBuilder {
|
||||
@ -32,6 +34,7 @@ export class AccountExport implements AccountExportBuilder {
|
||||
surveyResponses: SurveyResponse[];
|
||||
movies: Movie[];
|
||||
conversationMessages: ConversationMessage[];
|
||||
conversations: Conversation[];
|
||||
|
||||
public constructor(info: AccountExportBuilder) {
|
||||
for (const key in info) {
|
||||
|
@ -410,6 +410,9 @@ export class AccountHelper {
|
||||
|
||||
// Conversation messages
|
||||
conversationMessages: await ConversationsHelper.ExportAllMessages(userID),
|
||||
|
||||
// Conversations list
|
||||
conversations: await ConversationsHelper.GetListUser(userID),
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user