mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 05:19: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),
|
movies: data.movies.map(MoviesController.MovieToAPI),
|
||||||
|
|
||||||
// Conversations messages
|
// 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
|
* @param c
|
||||||
*/
|
*/
|
||||||
private static ConversationToAPI(c : Conversation) : any {
|
public static ConversationToAPI(c : Conversation) : any {
|
||||||
return {
|
return {
|
||||||
ID: c.id,
|
ID: c.id,
|
||||||
ID_owner: c.ownerID,
|
ID_owner: c.ownerID,
|
||||||
|
@ -11,6 +11,7 @@ import { UserLike } from "./UserLike";
|
|||||||
import { SurveyResponse } from "./SurveyResponse";
|
import { SurveyResponse } from "./SurveyResponse";
|
||||||
import { Movie } from "./Movie";
|
import { Movie } from "./Movie";
|
||||||
import { ConversationMessage } from "./ConversationMessage";
|
import { ConversationMessage } from "./ConversationMessage";
|
||||||
|
import { Conversation } from "./Conversation";
|
||||||
|
|
||||||
export interface AccountExportBuilder {
|
export interface AccountExportBuilder {
|
||||||
userID: number;
|
userID: number;
|
||||||
@ -21,6 +22,7 @@ export interface AccountExportBuilder {
|
|||||||
surveyResponses: SurveyResponse[];
|
surveyResponses: SurveyResponse[];
|
||||||
movies: Movie[];
|
movies: Movie[];
|
||||||
conversationMessages: ConversationMessage[];
|
conversationMessages: ConversationMessage[];
|
||||||
|
conversations: Conversation[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AccountExport implements AccountExportBuilder {
|
export class AccountExport implements AccountExportBuilder {
|
||||||
@ -32,6 +34,7 @@ export class AccountExport implements AccountExportBuilder {
|
|||||||
surveyResponses: SurveyResponse[];
|
surveyResponses: SurveyResponse[];
|
||||||
movies: Movie[];
|
movies: Movie[];
|
||||||
conversationMessages: ConversationMessage[];
|
conversationMessages: ConversationMessage[];
|
||||||
|
conversations: Conversation[];
|
||||||
|
|
||||||
public constructor(info: AccountExportBuilder) {
|
public constructor(info: AccountExportBuilder) {
|
||||||
for (const key in info) {
|
for (const key in info) {
|
||||||
|
@ -410,6 +410,9 @@ export class AccountHelper {
|
|||||||
|
|
||||||
// Conversation messages
|
// Conversation messages
|
||||||
conversationMessages: await ConversationsHelper.ExportAllMessages(userID),
|
conversationMessages: await ConversationsHelper.ExportAllMessages(userID),
|
||||||
|
|
||||||
|
// Conversations list
|
||||||
|
conversations: await ConversationsHelper.GetListUser(userID),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user