summaryrefslogtreecommitdiffstats
path: root/ui/src/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r--ui/src/utils.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index dc221716..363de663 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -15,6 +15,7 @@ import {
SortType,
ListingType,
SearchType,
+ WebSocketResponse,
} from './interfaces';
import { UserService } from './services/UserService';
import markdown_it from 'markdown-it';
@@ -38,9 +39,12 @@ export function randomStr() {
.substr(2, 10);
}
-export function msgOp(msg: any): UserOperation {
+export function wsJsonToRes(msg: any): WebSocketResponse {
let opStr: string = msg.op;
- return UserOperation[opStr];
+ return {
+ op: UserOperation[opStr],
+ data: msg.data,
+ };
}
export const md = new markdown_it({