fixing: ppob
This commit is contained in:
@@ -27,4 +27,9 @@ export class Partner extends BaseModel {
|
||||
|
||||
@Column({ default: true })
|
||||
status: boolean;
|
||||
|
||||
@Column({
|
||||
default: '',
|
||||
})
|
||||
callback_url: string;
|
||||
}
|
||||
|
||||
@@ -20,12 +20,15 @@ import * as uuid from 'uuid';
|
||||
import { UserDetail } from './entities/user_detail.entity';
|
||||
import { COA } from '../transaction/entities/coa.entity';
|
||||
import { mapSeries } from 'bluebird';
|
||||
import { Partner } from './entities/partner.entity';
|
||||
|
||||
@Injectable()
|
||||
export class UsersService {
|
||||
constructor(
|
||||
@InjectRepository(User)
|
||||
private usersRepository: Repository<User>,
|
||||
@InjectRepository(Partner)
|
||||
private partnerRepository: Repository<Partner>,
|
||||
@InjectRepository(UserDetail)
|
||||
private userDetailRepository: Repository<UserDetail>,
|
||||
@Inject(
|
||||
@@ -676,4 +679,26 @@ export class UsersService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async findPartner(partnerId: string) {
|
||||
try {
|
||||
return this.partnerRepository.findOneOrFail({
|
||||
where: {
|
||||
id: partnerId,
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof EntityNotFoundError) {
|
||||
throw new HttpException(
|
||||
{
|
||||
statusCode: HttpStatus.NOT_FOUND,
|
||||
error: 'Partner not found',
|
||||
},
|
||||
HttpStatus.NOT_FOUND,
|
||||
);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user