Almost finalised refactoring
This commit is contained in:
@ -6,7 +6,7 @@ interface IPayload {}
|
||||
|
||||
export default class MapListEvent extends BaseEvent {
|
||||
public listen(): void {
|
||||
this.socket.on('gm:map_editor:map:list', this.handleEvent.bind(this))
|
||||
this.socket.on('gm:map:list', this.handleEvent.bind(this))
|
||||
}
|
||||
|
||||
private async handleEvent(data: IPayload, callback: (response: Map[]) => void): Promise<void> {
|
||||
@ -18,7 +18,7 @@ export default class MapListEvent extends BaseEvent {
|
||||
const maps = await MapRepository.getAll()
|
||||
return callback(maps)
|
||||
} catch (error: any) {
|
||||
this.logger.error('gm:map_editor:map:list error', error.message)
|
||||
this.logger.error('gm:map:list error', error.message)
|
||||
return callback([])
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user