Skip to content

Instantly share code, notes, and snippets.

@dewey92
Last active October 19, 2018 23:59
Show Gist options
  • Select an option

  • Save dewey92/ecf05d845ed3d7a1ef31cfe5afe7847a to your computer and use it in GitHub Desktop.

Select an option

Save dewey92/ecf05d845ed3d7a1ef31cfe5afe7847a to your computer and use it in GitHub Desktop.
TS doc
export interface TimeSlot {
deliveryId: number;
from: string;
to: string;
}
export interface DeliveryTimeResponse {
date: string;
slots: {
DayTime: TimeSlot;
Evening: TimeSlot;
};
}
export interface DeliveryTimeModel {
date: Date;
slots: TimeSlot[];
}
const transformDeliveryTimeResponse = (
raw: DeliveryTimeResponse
): DeliveryTimeModel => ({
date: new Date(raw.date),
slots: Object.values(res.slots),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment