Last active
October 19, 2018 23:59
-
-
Save dewey92/ecf05d845ed3d7a1ef31cfe5afe7847a to your computer and use it in GitHub Desktop.
TS doc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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