mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-23 22:09:23 +00:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
/**
|
|
* 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";
|
|
import { LikesController } from "./LikesController";
|
|
import { UserWebSocketActions } from "./UserWebSocketActions";
|
|
|
|
export interface UserWebSocketRoute {
|
|
title: string,
|
|
handler: (h: UserWebSocketRequestsHandler) => Promise<void>
|
|
}
|
|
|
|
export const UserWebSocketRoutes: UserWebSocketRoute[] = [
|
|
|
|
// Main controller
|
|
{title: "$main/set_incognito", handler: (h) => UserWebSocketActions.SetIncognito(h)},
|
|
|
|
{title: "$main/register_conv", handler: (h) => UserWebSocketActions.RegisterConv(h)},
|
|
{title: "$main/unregister_conv", handler: (h) => UserWebSocketActions.UnregisterConv(h)},
|
|
|
|
{title: "$main/register_post", handler: (h) => UserWebSocketActions.RegisterPost(h)},
|
|
{title: "$main/unregister_post", handler: (h) => UserWebSocketActions.UnregisterPost(h)},
|
|
|
|
// Likes controller
|
|
{title: "likes/update", handler: (h) => LikesController.Update(h)},
|
|
|
|
|
|
] |