refactor cart

This commit is contained in:
2026-02-09 14:29:21 +03:30
parent a21d1f6004
commit 626d8194d8
9 changed files with 67 additions and 125 deletions
@@ -14,7 +14,7 @@ export class DeliveryService {
private readonly deliveryRepository: DeliveryRepository,
private readonly shopRepository: ShopRepository,
private readonly em: EntityManager,
) {}
) { }
async create(restId: string, createDto: CreateDeliveryDto): Promise<Delivery> {
const shop = await this.shopRepository.findOne({ id: restId });
@@ -54,7 +54,7 @@ export class DeliveryService {
return this.deliveryRepository.find({ shop: { id: restId } }, { orderBy: { order: 'asc' } });
}
async findOne(restId: string, deliveryId: string): Promise<Delivery> {
async findOrFail(restId: string, deliveryId: string): Promise<Delivery> {
const delivery = await this.deliveryRepository.findOne({
id: deliveryId,
shop: { id: restId },