mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 15:50:32 +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) {
|
async getExpensesList(req: Request, res: Response, next: NextFunction) {
|
||||||
const { tenantId } = req;
|
const { tenantId } = req;
|
||||||
const filter = {
|
const filter = {
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ export default class ServiceErrors {
|
|||||||
|
|
||||||
hasType(errorType: string) {
|
hasType(errorType: string) {
|
||||||
return this.errors
|
return this.errors
|
||||||
.filter((error: ServiceError) => error.errorType === errorType);
|
.some((error: ServiceError) => error.errorType === errorType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,16 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface IRegisterDTO {
|
export interface IRegisterDTO {
|
||||||
firstName: string,
|
firstName: string,
|
||||||
lastName: string,
|
lastName: string,
|
||||||
email: string,
|
email: string,
|
||||||
password: string,
|
password: string,
|
||||||
organizationName: 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.
|
* Sends reset password message.
|
||||||
*
|
|
||||||
* @param {ISystemUser} user - The system user.
|
* @param {ISystemUser} user - The system user.
|
||||||
* @param {string} token - Reset password token.
|
* @param {string} token - Reset password token.
|
||||||
* @return {Promise<void>}
|
* @return {Promise<void>}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export default class AuthenticationService {
|
|||||||
this.logger.info('[register] Someone trying to register.');
|
this.logger.info('[register] Someone trying to register.');
|
||||||
await this.validateEmailAndPhoneUniqiness(registerDTO);
|
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();
|
const tenant = await this.newTenantOrganization();
|
||||||
|
|
||||||
this.logger.info('[register] Trying hashing the password.')
|
this.logger.info('[register] Trying hashing the password.')
|
||||||
|
|||||||
Reference in New Issue
Block a user