This commit is contained in:
2025-12-07 10:26:09 +03:30
parent be0185e6bd
commit f762b03260
4 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -489,7 +489,7 @@ export class CartService {
*/
async setAddress(userId: string, restaurantId: string, setAddressDto: SetAddressDto): Promise<Cart> {
const cart = await this.findOneOrFail(userId, restaurantId);
if (!cart.deliveryMethodId) throw new BadRequestException('Delivery method must be set before setting address');
// Find and validate address belongs to user
const address = await this.em.findOne(UserAddress, { id: setAddressDto.addressId }, { populate: ['user'] });