1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00

Export the list of friends

This commit is contained in:
Pierre HUBERT 2020-03-26 13:29:39 +01:00
parent 830c871ed4
commit aef43df39e
3 changed files with 13 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import { LikesController } from "./LikesController";
import { SurveyController } from "./SurveyController"; import { SurveyController } from "./SurveyController";
import { MoviesController } from "./MoviesController"; import { MoviesController } from "./MoviesController";
import { ConversationsController } from "./ConversationsController"; import { ConversationsController } from "./ConversationsController";
import { FriendsController } from "./FriendsController";
/** /**
* Account controller * Account controller
@ -258,7 +259,10 @@ export class AccountController {
conversations_list: data.conversations.map(ConversationsController.ConversationToAPI), conversations_list: data.conversations.map(ConversationsController.ConversationToAPI),
// Conversation messages // Conversation messages
conversation_messages: {} conversation_messages: {},
// Friends list
friends_list: data.friendsList.map(f => FriendsController.FriendToAPI(f, false))
}; };
// Fill conversation messages entry // Fill conversation messages entry

View File

@ -12,6 +12,7 @@ import { SurveyResponse } from "./SurveyResponse";
import { Movie } from "./Movie"; import { Movie } from "./Movie";
import { ConversationMessage } from "./ConversationMessage"; import { ConversationMessage } from "./ConversationMessage";
import { Conversation } from "./Conversation"; import { Conversation } from "./Conversation";
import { Friend } from "./Friend";
export interface AccountExportBuilder { export interface AccountExportBuilder {
userID: number; userID: number;
@ -24,6 +25,7 @@ export interface AccountExportBuilder {
allConversationMessages: ConversationMessage[]; allConversationMessages: ConversationMessage[];
conversations: Conversation[]; conversations: Conversation[];
conversationsMessages: Map<number, ConversationMessage[]>; conversationsMessages: Map<number, ConversationMessage[]>;
friendsList: Friend[];
} }
export class AccountExport implements AccountExportBuilder { export class AccountExport implements AccountExportBuilder {
@ -37,6 +39,7 @@ export class AccountExport implements AccountExportBuilder {
allConversationMessages: ConversationMessage[]; allConversationMessages: ConversationMessage[];
conversations: Conversation[]; conversations: Conversation[];
conversationsMessages: Map<number, ConversationMessage[]>; conversationsMessages: Map<number, ConversationMessage[]>;
friendsList: Friend[];
public constructor(info: AccountExportBuilder) { public constructor(info: AccountExportBuilder) {
for (const key in info) { for (const key in info) {

View File

@ -13,6 +13,7 @@ import { LikesHelper } from "./LikesHelper";
import { SurveyHelper } from "./SurveyHelper"; import { SurveyHelper } from "./SurveyHelper";
import { MoviesHelper } from "./MoviesHelper"; import { MoviesHelper } from "./MoviesHelper";
import { ConversationsHelper } from "./ConversationsHelper"; import { ConversationsHelper } from "./ConversationsHelper";
import { FriendsHelper } from "./FriendsHelper";
/** /**
* Account helper * Account helper
@ -415,7 +416,10 @@ export class AccountHelper {
conversations: await ConversationsHelper.GetListUser(userID), conversations: await ConversationsHelper.GetListUser(userID),
// Conversations messages (completed after) // Conversations messages (completed after)
conversationsMessages: new Map() conversationsMessages: new Map(),
// Friends
friendsList: await FriendsHelper.GetList(userID)
}) })
// Process conversation messages // Process conversation messages