mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix: method hasType in service errors.
This commit is contained in:
@@ -228,7 +228,12 @@ export default class ExpensesController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve expneses list.
|
||||
* @param {Request} req
|
||||
* @param {Response} res
|
||||
* @param {NextFunction} next
|
||||
*/
|
||||
async getExpensesList(req: Request, res: Response, next: NextFunction) {
|
||||
const { tenantId } = req;
|
||||
const filter = {
|
||||
|
||||
@@ -10,6 +10,6 @@ export default class ServiceErrors {
|
||||
|
||||
hasType(errorType: string) {
|
||||
return this.errors
|
||||
.filter((error: ServiceError) => error.errorType === errorType);
|
||||
.some((error: ServiceError) => error.errorType === errorType);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
|
||||
|
||||
|
||||
export interface IRegisterDTO {
|
||||
firstName: string,
|
||||
lastName: string,
|
||||
email: string,
|
||||
password: string,
|
||||
organizationName: string,
|
||||
};
|
||||
|
||||
export interface IPasswordReset {
|
||||
id: number,
|
||||
email: string,
|
||||
token: string,
|
||||
createdAt: Date,
|
||||
};
|
||||
@@ -42,7 +42,6 @@ export default class AuthenticationMailMesssages {
|
||||
|
||||
/**
|
||||
* Sends reset password message.
|
||||
*
|
||||
* @param {ISystemUser} user - The system user.
|
||||
* @param {string} token - Reset password token.
|
||||
* @return {Promise<void>}
|
||||
|
||||
@@ -126,7 +126,7 @@ export default class AuthenticationService {
|
||||
this.logger.info('[register] Someone trying to register.');
|
||||
await this.validateEmailAndPhoneUniqiness(registerDTO);
|
||||
|
||||
this.logger.info('[register] Creating a new tenant organization.')
|
||||
this.logger.info('[register] Creating a new tenant organization.');
|
||||
const tenant = await this.newTenantOrganization();
|
||||
|
||||
this.logger.info('[register] Trying hashing the password.')
|
||||
|
||||
Reference in New Issue
Block a user