add: top up saldo supplier

This commit is contained in:
ilham
2021-12-12 00:23:13 +07:00
parent 14a00988d9
commit ed5ca6556d
5 changed files with 42 additions and 18 deletions

View File

@@ -94,9 +94,11 @@ export class SupplierService {
});
}
async findOne(id: string) {
async findByCode(code: string) {
try {
return await this.supplierRepository.findOneOrFail(id);
return await this.supplierRepository.findOneOrFail({
code: code,
});
} catch (e) {
if (e instanceof EntityNotFoundError) {
throw new HttpException(

View File

@@ -16,6 +16,6 @@ import { Supplier } from './entities/supplier.entity';
],
controllers: [UsersController],
providers: [UsersService, SupplierService],
exports: [UsersService],
exports: [UsersService, SupplierService],
})
export class UsersModule {}