diff options
author | Dessalines <tyhou13@gmx.com> | 2020-01-23 19:17:42 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-01-23 19:17:42 -0500 |
commit | ac1d5f2b86b0816cc9b5794dc6c38a38365ed839 (patch) | |
tree | bedaab04ca797113990e5702cad36f5e34e9e6e8 /ui/src/utils.ts | |
parent | 39d1fb4450cb418d9c11b31ea99484c2a177fab6 (diff) | |
parent | b45c83682c187737b092080e83ba741c39cfa695 (diff) |
Done merging http-api and private_message
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r-- | ui/src/utils.ts | 9 |
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({ |