2020-03-31 12:42:53 +00:00
|
|
|
/**
|
|
|
|
* User Websocket requests route
|
|
|
|
*
|
|
|
|
* Note : this implementation requires the
|
|
|
|
* user to be signed in to perform requests
|
|
|
|
*
|
|
|
|
* @author Pierre Hubert
|
|
|
|
*/
|
|
|
|
|
|
|
|
import { UserWebSocketRequestsHandler } from "../entities/WebSocketRequestHandler";
|
2020-03-31 14:42:35 +00:00
|
|
|
import { LikesController } from "./LikesController";
|
2020-04-01 08:44:49 +00:00
|
|
|
import { UserWebSocketActions } from "./UserWebSocketActions";
|
2020-03-31 12:42:53 +00:00
|
|
|
|
|
|
|
export interface UserWebSocketRoute {
|
|
|
|
title: string,
|
|
|
|
handler: (h: UserWebSocketRequestsHandler) => Promise<void>
|
|
|
|
}
|
|
|
|
|
2020-03-31 14:42:35 +00:00
|
|
|
export const UserWebSocketRoutes: UserWebSocketRoute[] = [
|
|
|
|
|
2020-04-01 08:44:49 +00:00
|
|
|
// Main controller
|
|
|
|
{title: "$main/set_incognito", handler: (h) => UserWebSocketActions.SetIncognito(h)},
|
|
|
|
|
2020-03-31 14:42:35 +00:00
|
|
|
// Likes controller
|
|
|
|
{title: "likes/update", handler: (h) => LikesController.Update(h)},
|
|
|
|
|
|
|
|
|
|
|
|
]
|