Skip to content

Commit

Permalink
Merge pull request #28 from deviate-team/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
TeetouchQQ authored Aug 9, 2023
2 parents 0fd7fb1 + f822ec9 commit 6fd6858
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ export class UsersController {
@Roles(Role.User, Role.Provider, Role.Admin) //for dev
async addMoney(
@Param('id') id: string,
@Body() addMoneyDto: AddMoneyDto,
@GetUser() user)
@Body() addMoneyDto: AddMoneyDto)
{
const addMoney = await this.usersService.addMoney(id,addMoneyDto, user);
const addMoney = await this.usersService.addMoney(id,addMoneyDto);
return {
message: 'success',
data: addMoney
Expand Down
7 changes: 3 additions & 4 deletions src/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class UsersService {
return await this.userModel.find().select('-__v -password').exec();
}

async addMoney(id: string, addMoneyDto: AddMoneyDto,user) {
async addMoney(id: string, addMoneyDto: AddMoneyDto) {
const moneyType = addMoneyDto.option;
const quantity = addMoneyDto.quantity;
if(quantity < 0){
Expand All @@ -82,7 +82,6 @@ export class UsersService {
);
}
const userExists = await this.findOneById(id);
console.log(userExists);
if (!userExists) {
throw new HttpException(
{
Expand All @@ -103,8 +102,8 @@ export class UsersService {
}

userExists.save();
console.log(userExists);
return await userExists;
//console.log(userExists);
return userExists;
}
}
}
Expand Down

0 comments on commit 6fd6858

Please sign in to comment.