add saldo IRS

This commit is contained in:
2021-12-09 03:22:52 +07:00
parent 84fda27e2d
commit 1f44cf484c
7 changed files with 114 additions and 19 deletions

View File

@@ -50,4 +50,22 @@ export class CoaService {
}
}
}
async findByName(name: string) {
try {
return await this.coaRepository.findOneOrFail({ name: name });
} catch (e) {
if (e instanceof EntityNotFoundError) {
throw new HttpException(
{
statusCode: HttpStatus.NOT_FOUND,
error: 'COA Data not found',
},
HttpStatus.NOT_FOUND,
);
} else {
throw e;
}
}
}
}