1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/backend/model/UserManager.ts
2016-04-08 14:48:29 +02:00

32 lines
996 B
TypeScript

import {User} from "../../common/entities/User";
export class UserManager {
private static users = [new User(1,"TestUser","test@test.hu","122345")];
public static findOne(filter,cb:(error: any,result:User) => void){
return cb(null, UserManager.users[0]);
}
public static find(filter,cb:(error: any,result:Array<User>) => void){
return cb(null, UserManager.users);
}
public static createUser(user,cb:(error: any,result:User) => void){
UserManager.users.push(user);
return cb(null, user);
}
public static deleteUser(id:number,cb:(error: any,result:string) => void){
UserManager.users = UserManager.users.filter(u => u.id != id);
return cb(null, "ok");
}
public static changeRole(request:any,cb:(error: any,result:string) => void){
return cb(null,"ok");
}
public static changePassword(request:any,cb:(error: any,result:string) => void){
return cb(null,"ok");
}
}