summaryrefslogtreecommitdiffstats
path: root/ui/src/utils.ts
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-23 19:17:42 -0500
committerDessalines <tyhou13@gmx.com>2020-01-23 19:17:42 -0500
commitac1d5f2b86b0816cc9b5794dc6c38a38365ed839 (patch)
treebedaab04ca797113990e5702cad36f5e34e9e6e8 /ui/src/utils.ts
parent39d1fb4450cb418d9c11b31ea99484c2a177fab6 (diff)
parentb45c83682c187737b092080e83ba741c39cfa695 (diff)
Done merging http-api and private_message
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r--ui/src/utils.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index a3aab09d..0e4cd9d5 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -16,6 +16,8 @@ import {
SortType,
ListingType,
SearchType,
+ WebSocketResponse,
+ WebSocketJsonResponse,
} from './interfaces';
import { UserService } from './services/UserService';
import markdown_it from 'markdown-it';
@@ -40,9 +42,12 @@ export function randomStr() {
.substr(2, 10);
}
-export function msgOp(msg: any): UserOperation {
+export function wsJsonToRes(msg: WebSocketJsonResponse): WebSocketResponse {
let opStr: string = msg.op;
- return UserOperation[opStr];
+ return {
+ op: UserOperation[opStr],
+ data: msg.data,
+ };
}
export const md = new markdown_it({