forked from noxious/server
Updated create and update calls to services
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Character } from '@prisma/client'
|
||||
import prisma from '../utilities/prisma'
|
||||
import { CharacterService } from '../services/character/characterService'
|
||||
|
||||
class ZoneCharacter {
|
||||
public readonly character: Character
|
||||
@ -11,15 +11,8 @@ class ZoneCharacter {
|
||||
}
|
||||
|
||||
public async savePosition() {
|
||||
await prisma.character.update({
|
||||
where: { id: this.character.id },
|
||||
data: {
|
||||
positionX: this.character.positionX,
|
||||
positionY: this.character.positionY,
|
||||
rotation: this.character.rotation,
|
||||
zoneId: this.character.zoneId
|
||||
}
|
||||
})
|
||||
const characterService = new CharacterService()
|
||||
await characterService.updateCharacterPosition(this.character.id, this.character.positionX, this.character.positionY, this.character.rotation, this.character.zoneId)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user