mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-09 15:35:25 +02:00
rm: user model and controller removed
This commit is contained in:
parent
1fb4cf3106
commit
582635b4c7
2 changed files with 0 additions and 61 deletions
|
@ -1,20 +0,0 @@
|
|||
import User from '../models/user';
|
||||
|
||||
/**
|
||||
* @class Users
|
||||
* @classdesc Users controller
|
||||
*/
|
||||
class Users {
|
||||
/**
|
||||
* Find and return user model.
|
||||
*
|
||||
* @returns {Promise<User>}
|
||||
*/
|
||||
public static async get(): Promise<User> {
|
||||
const userData: User = await User.get();
|
||||
|
||||
return userData;
|
||||
}
|
||||
}
|
||||
|
||||
export default Users;
|
|
@ -1,41 +0,0 @@
|
|||
import * as dotenv from 'dotenv';
|
||||
|
||||
dotenv.config();
|
||||
export interface UserData {
|
||||
password?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @class User
|
||||
* @class User model
|
||||
*
|
||||
* @property {string} passHash - hashed password
|
||||
*/
|
||||
class User {
|
||||
public password?: string;
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @param {UserData} userData - user data for construct new object
|
||||
*/
|
||||
constructor(userData: UserData) {
|
||||
this.password = userData.password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find and return model of user.
|
||||
* User is only one.
|
||||
*
|
||||
* @returns {Promise<User>}
|
||||
*/
|
||||
public static async get(): Promise<User> {
|
||||
const userData: UserData = {
|
||||
password: process.env.PASSWORD,
|
||||
};
|
||||
|
||||
return new User(userData);
|
||||
}
|
||||
}
|
||||
|
||||
export default User;
|
Loading…
Add table
Add a link
Reference in a new issue