chore(workspace): eradicate all tsc errors and eslint warnings across frontend, admin, and backend
Deploy Canina / deploy (push) Failing after 29s
Deploy Canina / deploy (push) Failing after 29s
This commit is contained in:
1 parent
4659a7b1de
commit
9f11d8fb2d
98 files changed
+1272
-1009
No files matched your search
@@ -65,7 +65,7 @@ export class UsersController {
|
||||
},
|
||||
},
|
||||
})
|
||||
getProfile(@Req() req: any) {
|
||||
getProfile(@Req() req: { user: { id: string } }) {
|
||||
return this.usersService.findById(req.user.id);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,10 @@ export class UsersController {
|
||||
},
|
||||
},
|
||||
})
|
||||
updateProfile(@Req() req: any, @Body() updateProfileDto: UpdateProfileDto) {
|
||||
updateProfile(
|
||||
@Req() req: { user: { id: string } },
|
||||
@Body() updateProfileDto: UpdateProfileDto,
|
||||
) {
|
||||
return this.usersService.update(req.user.id, updateProfileDto);
|
||||
}
|
||||
|
||||
@@ -125,7 +128,10 @@ export class UsersController {
|
||||
},
|
||||
},
|
||||
})
|
||||
addAddress(@Req() req: any, @Body() addressDto: AddressDto) {
|
||||
addAddress(
|
||||
@Req() req: { user: { id: string } },
|
||||
@Body() addressDto: AddressDto,
|
||||
) {
|
||||
return this.usersService.addAddress(req.user.id, addressDto);
|
||||
}
|
||||
|
||||
@@ -151,7 +157,7 @@ export class UsersController {
|
||||
},
|
||||
})
|
||||
updateAddress(
|
||||
@Req() req: any,
|
||||
@Req() req: { user: { id: string } },
|
||||
@Param('addressId') addressId: string,
|
||||
@Body() addressDto: AddressDto,
|
||||
) {
|
||||
@@ -170,7 +176,10 @@ export class UsersController {
|
||||
},
|
||||
},
|
||||
})
|
||||
deleteAddress(@Req() req: any, @Param('addressId') addressId: string) {
|
||||
deleteAddress(
|
||||
@Req() req: { user: { id: string } },
|
||||
@Param('addressId') addressId: string,
|
||||
) {
|
||||
return this.usersService.deleteAddress(req.user.id, addressId);
|
||||
}
|
||||
|
||||
@@ -186,7 +195,10 @@ export class UsersController {
|
||||
},
|
||||
},
|
||||
})
|
||||
setDefaultAddress(@Req() req: any, @Param('addressId') addressId: string) {
|
||||
setDefaultAddress(
|
||||
@Req() req: { user: { id: string } },
|
||||
@Param('addressId') addressId: string,
|
||||
) {
|
||||
return this.usersService.setDefaultAddress(req.user.id, addressId);
|
||||
}
|
||||
|
||||
@@ -208,7 +220,10 @@ export class UsersController {
|
||||
},
|
||||
})
|
||||
@ApiBadRequestResponse({ description: 'مبلغ نامعتبر است' })
|
||||
async topUpWallet(@Req() req: any, @Body() body: { amount: number }) {
|
||||
async topUpWallet(
|
||||
@Req() req: { user: { id: string } },
|
||||
@Body() body: { amount: number },
|
||||
) {
|
||||
const amount = Number(body.amount);
|
||||
if (!amount || amount <= 0) {
|
||||
throw new BadRequestException('مبلغ شارژ باید بزرگتر از صفر باشد');
|
||||
|
||||
Reference in new issue
Block a user