Almost finalised refactoring
This commit is contained in:
@ -10,7 +10,7 @@ type Payload = {
|
||||
|
||||
export default class MapCreateEvent extends BaseEvent {
|
||||
public listen(): void {
|
||||
this.socket.on('gm:map_editor:map:create', this.handleEvent.bind(this))
|
||||
this.socket.on('gm:map:create', this.handleEvent.bind(this))
|
||||
}
|
||||
|
||||
private async handleEvent(data: Payload, callback: (response: Map[]) => void): Promise<void> {
|
||||
@ -30,7 +30,7 @@ export default class MapCreateEvent extends BaseEvent {
|
||||
const mapList = await MapRepository.getAll()
|
||||
return callback(mapList)
|
||||
} catch (error: any) {
|
||||
this.logger.error('gm:map_editor:map:create error', error.message)
|
||||
this.logger.error('gm:map:create error', error.message)
|
||||
this.socket.emit('notification', { message: 'Failed to create map.' })
|
||||
return callback([])
|
||||
}
|
||||
|
Reference in New Issue
Block a user