distribute saldo
This commit is contained in:
@@ -51,6 +51,24 @@ export class CoaService {
|
||||
}
|
||||
}
|
||||
|
||||
async findByUserWithRelated(id: string, relatedId: string, typeOfCoa: coaType) {
|
||||
try {
|
||||
return await this.coaRepository.findOneOrFail({ user: id, type: typeOfCoa, relatedUser:relatedId });
|
||||
} catch (e) {
|
||||
if (e instanceof EntityNotFoundError) {
|
||||
throw new HttpException(
|
||||
{
|
||||
statusCode: HttpStatus.NOT_FOUND,
|
||||
error: 'Coa Data not found',
|
||||
},
|
||||
HttpStatus.NOT_FOUND,
|
||||
);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async findByName(name: string) {
|
||||
try {
|
||||
return await this.coaRepository.findOneOrFail({ name: name });
|
||||
|
||||
Reference in New Issue
Block a user