end points to get current points and wallet
This commit is contained in:
@@ -14,11 +14,15 @@ import { API_HEADER_SLUG } from 'src/common/constants/index';
|
||||
import { UserSuccessMessage } from 'src/common/enums/message.enum';
|
||||
import { Permissions } from 'src/common/decorators/permissions.decorator';
|
||||
import { Permission } from 'src/common/enums/permission.enum';
|
||||
import { WalletService } from '../providers/wallet.service';
|
||||
|
||||
@ApiTags('User')
|
||||
@Controller()
|
||||
export class UsersController {
|
||||
constructor(private readonly userService: UserService) { }
|
||||
constructor(
|
||||
private readonly userService: UserService,
|
||||
private readonly walletService: WalletService,
|
||||
) {}
|
||||
|
||||
@UseGuards(AuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@@ -55,9 +59,19 @@ export class UsersController {
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Get User Wallet' })
|
||||
@ApiHeader(API_HEADER_SLUG)
|
||||
@Get('public/user/wallet')
|
||||
@Get('public/user/wallet/balance')
|
||||
async getUserWalletBalance(@UserId() userId: string, @RestId() restId: string) {
|
||||
const wallet = await this.walletService.getUserCurrentWalletBalance(userId, restId);
|
||||
return wallet;
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Get User Wallet' })
|
||||
@ApiHeader(API_HEADER_SLUG)
|
||||
@Get('public/user/points/balance')
|
||||
async getUserWallet(@UserId() userId: string, @RestId() restId: string) {
|
||||
const wallet = await this.userService.getUserWallet(userId, restId);
|
||||
const wallet = await this.walletService.getUserCurrentPoinrBalance(userId, restId);
|
||||
return wallet;
|
||||
}
|
||||
|
||||
@@ -166,6 +180,4 @@ export class UsersController {
|
||||
) {
|
||||
return this.userService.findAll(restId, query);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user