Skip to content

Commit dd63c48

Browse files
committed
some bugs fixed.
this may worknow!
1 parent 662d607 commit dd63c48

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/handlers/initDatabase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export = class DatabaseInitializer {
99
private client: any;
1010

1111
constructor(client: any) {
12-
if (!client) return new Error(`client is required`);
12+
if (!client) throw new Error(`client is required`);
1313
this.client = client;
1414
}
1515

@@ -397,7 +397,7 @@ export = class DatabaseInitializer {
397397
];
398398

399399
for (const schema of schemas) {
400-
const id = schema._id.$oid;
400+
const id = schema._id;
401401
let schemaDb = await userData.findOne({ _id: id }).catch(() => {});
402402
if (schemaDb) continue;
403403
schemaDb = await new userData(this.convertIdsRecursive(schema)).save();

src/handlers/types.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Server } from "socket.io";
2+
import { EventEmitter } from "events";
3+
4+
export interface Client {
5+
server: any;
6+
config: any;
7+
links: string[];
8+
parseURL: (link: string) => any;
9+
ipport: (link: string, port: number) => string;
10+
port: number;
11+
logger: any;
12+
wspaths: Map<string, any>;
13+
io: Server;
14+
wsevents: EventEmitter;
15+
}

0 commit comments

Comments
 (0)