Skip to content

Commit

Permalink
Fixed reviewss
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Goriachkin authored and Evgenii Goriachkin committed Sep 3, 2022
1 parent d5949f1 commit 8e85c2f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions authorization/controllers/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { changePasswordLimiter } from '../functions/rate.limit';
@singleton()
@Controller('/users')
export class UserController {
constructor(private userService: UserService) {}
constructor(private userService: UserService) { }

@Get('')
@Middleware([verifyToken, isAdmin])
Expand All @@ -40,7 +40,7 @@ export class UserController {
}
}

@Get('/inner:id')
@Get('inner/:id')
async getUserById(req: Request, resp: Response) {
const { secretKey } = req.body;

Expand Down Expand Up @@ -177,7 +177,7 @@ export class UserController {
}
}

@Delete('user:id')
@Delete('user/:id')
@Middleware([verifyToken, isAdmin])
async removeUser(req: Request, resp: Response) {
const { id } = req.params;
Expand Down
2 changes: 1 addition & 1 deletion orders/address/address.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class AddressService {

async getUserById(id: string, authToken: string): Promise<UserDTO | undefined> {
try {
const res = await axios.get(`${process.env.USERS_DB}/users/${id}`, {
const res = await axios.get(`${process.env.USERS_DB}/users/inner/${id}`, {
headers: {
Authorization: authToken!,
},
Expand Down
2 changes: 1 addition & 1 deletion orders/basket/basket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class BasketService {

async getUserById(id: string, authToken: string): Promise<UserDTO | undefined> {
try {
const res = await axios.get(`${process.env.USERS_DB}/users/${id}`, {
const res = await axios.get(`${process.env.USERS_DB}/users/inner/${id}`, {
headers: {
Authorization: authToken!
}
Expand Down
2 changes: 1 addition & 1 deletion orders/checkout/checkout.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class CheckoutService {

async getUserById(id: string): Promise<UserDTO | undefined> {
const options = {
url: `${process.env.USERS_DB}/users/${id}`,
url: `${process.env.USERS_DB}/users/inner/${id}`,
method: 'GET',
headers: {
'Accept': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion orders/orderProducts/orderProduct.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class OrderProductService {

async getUserById(id: string, authToken: string): Promise<UserDTO | undefined> {
try {
const res = await axios.get(`${process.env.USERS_DB}/users/${id}`, {
const res = await axios.get(`${process.env.USERS_DB}/users/inner/${id}`, {
headers: {
Authorization: authToken!,
},
Expand Down
2 changes: 1 addition & 1 deletion reviews/review/review.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ReviewService {
queryBuilder.andWhere('review.userId = :userId', { userId: userId });
}
if (showOnMain) {
queryBuilder.andWhere('review.showOnMain = :showOnMain', { showOnMain: showOnMain });
queryBuilder.andWhere('review.showOnMain = :showOnMain', { showOnMain: JSON.parse(showOnMain as any) });
}

queryBuilder.orderBy(`review.${sortBy}`, orderBy).skip(offset).take(limit);
Expand Down

0 comments on commit 8e85c2f

Please sign in to comment.