Commit 0593163d authored by nanahira's avatar nanahira

fix

parent 602f80dd
Pipeline #17342 passed with stages
in 33 seconds
......@@ -1791,7 +1791,13 @@ export class AppService {
select: ['username', 'exp'],
where: { username: user.username },
});
if (!userInfo || userInfo.exp < config.novelaiCost) {
if (!userInfo) {
this.log.log(
`${user.username} has no duel records, cannot use novelai.`,
);
throw new HttpException(new CodeResponseDto(402), 402);
}
if (userInfo.exp < config.novelaiCost) {
this.log.log(
`${user.username} has no enough exp to use novelai: ${userInfo.exp}`,
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment