review bug
This commit is contained in:
@@ -19,7 +19,7 @@ import { Cron, CronExpression } from '@nestjs/schedule';
|
||||
import { OrderRepository } from './repositories/order.repository';
|
||||
import { FindOrdersDto } from './dto/find-orders.dto';
|
||||
import { PaginatedResult } from 'src/common/interfaces/pagination.interface';
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class OrdersService {
|
||||
private readonly logger = new Logger(OrdersService.name);
|
||||
@@ -247,7 +247,24 @@ export class OrdersService {
|
||||
};
|
||||
}
|
||||
|
||||
async findAll(restId: string, dto: FindOrdersDto): Promise<PaginatedResult<Order>> {
|
||||
async findAllForUser(restId: string, dto: FindOrdersDto, userId: string): Promise<PaginatedResult<Order>> {
|
||||
const result = await this.orderRepository.findAllPaginated(restId, {
|
||||
page: dto.page,
|
||||
limit: dto.limit,
|
||||
status: dto.status,
|
||||
paymentStatus: dto.paymentStatus,
|
||||
search: dto.search,
|
||||
startDate: dto.startDate,
|
||||
endDate: dto.endDate,
|
||||
orderBy: dto.orderBy,
|
||||
order: dto.order,
|
||||
userId,
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async findAllForAdmin(restId: string, dto: FindOrdersDto): Promise<PaginatedResult<Order>> {
|
||||
const result = await this.orderRepository.findAllPaginated(restId, {
|
||||
page: dto.page,
|
||||
limit: dto.limit,
|
||||
|
||||
Reference in New Issue
Block a user