aids
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import bcrypt from "bcryptjs";
|
||||
import UserRepository from "../repositories/user.repository";
|
||||
import CharacterRepository from "../repositories/character.repository";
|
||||
|
||||
class UserService {
|
||||
async login(username: string, password: string): Promise<boolean | any> {
|
||||
@ -23,7 +24,12 @@ class UserService {
|
||||
}
|
||||
|
||||
const hashedPassword = await bcrypt.hash(password, 10);
|
||||
return await UserRepository.create(username, hashedPassword);
|
||||
const newUser = await UserRepository.create(username, hashedPassword);
|
||||
|
||||
// @TODO: Create a new character for the user
|
||||
const newCharacter = await CharacterRepository.create(newUser.id, newUser.username);
|
||||
|
||||
return newUser
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,7 @@ class ZoneService
|
||||
{
|
||||
async createDemoZone(): Promise<boolean>
|
||||
{
|
||||
const zoneRepo = new ZoneRepository();
|
||||
await zoneRepo.create("Demo Zone", 10, 10, [
|
||||
await ZoneRepository.create("Demo Zone", 10, 10, [
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
|
Reference in New Issue
Block a user