Skip to content

Commit

Permalink
refactor: use package type from config for pickup
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianSDV committed Oct 3, 2024
1 parent aad005d commit cd926d2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import {
getConfigKey,
type CarrierIdentifier,
} from '@myparcel-do/shared';
import {DeliveryTypeName, PackageTypeName, ShipmentOptionName} from '@myparcel/constants';
import {DeliveryTypeName, ShipmentOptionName} from '@myparcel/constants';
import {useSelectedValues} from '../useSelectedValues';
import {useSelectedPickupLocation} from '../useSelectedPickupLocation';
import {useResolvedDeliveryOptions} from '../useResolvedDeliveryOptions';
import {getResolvedValue, parseJson} from '../../utils';
import {type SelectedDeliveryMomentDelivery} from '../../types';
import {useConfigStore} from '../../stores';
import {FIELD_DELIVERY_MOMENT, FIELD_SHIPMENT_OPTIONS, HOME_OR_PICKUP_PICKUP} from '../../data';

const DELIVERY_DELIVERY_TYPES = Object.freeze([
Expand Down Expand Up @@ -59,13 +60,14 @@ export const useResolvedValues = (): ComputedRef<PickupOutput | DeliveryOutput |

if (selectedValues.homeOrPickup.value === HOME_OR_PICKUP_PICKUP && isDef(pickupLocation.location.value)) {
const {carrier, openingHours, ...location} = pickupLocation.location.value;
const config = useConfigStore();

return {
carrier,
date: undefined,
deliveryType: DeliveryTypeName.Pickup,
isPickup: true,
packageType: PackageTypeName.Package,
packageType: config.packageType,
pickupLocation: location,
shipmentOptions: {},
} satisfies PickupOutput;
Expand Down

0 comments on commit cd926d2

Please sign in to comment.