mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-27 07:49:22 +00:00
24 lines
422 B
TypeScript
24 lines
422 B
TypeScript
|
import { Friend } from "../entities/Friend";
|
||
|
|
||
|
/**
|
||
|
* Friends controller
|
||
|
*
|
||
|
* @author Pierre HUBERT
|
||
|
*/
|
||
|
|
||
|
export class FriendsController {
|
||
|
|
||
|
/**
|
||
|
* Turn a friend object into an API entry
|
||
|
*
|
||
|
* @param friend Friend object to transform
|
||
|
*/
|
||
|
public static FriendToAPI(friend: Friend) : any {
|
||
|
return {
|
||
|
ID_friend: friend.friendID,
|
||
|
accepted: friend.accepted,
|
||
|
time_last_activity: friend.lastActivityTime
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|