File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,14 @@ const getMaxSeats = restaurantId => restaurant.getMaxSeats(restaurantId);
12
12
const getOpenSeats = ( {
13
13
restaurantId, date,
14
14
} ) => restaurant . getBookingsForDate ( restaurantId , date )
15
- . then ( ( res ) => {
16
- const seatsBookedAtTime = res . reduce ( ( acc , curr ) => {
17
- if ( acc [ curr . time ] ) {
18
- acc [ curr . time ] += curr . party ;
19
- } else {
20
- acc [ curr . time ] = curr . party ;
21
- }
22
- return acc ;
23
- } , { } ) ;
24
- return seatsBookedAtTime ;
25
- } )
15
+ . then ( res => res . reduce ( ( acc , curr ) => {
16
+ if ( acc [ curr . time ] ) {
17
+ acc [ curr . time ] += curr . party ;
18
+ } else {
19
+ acc [ curr . time ] = curr . party ;
20
+ }
21
+ return acc ;
22
+ } , { } ) )
26
23
. then ( seatsBooked => (
27
24
getMaxSeats ( restaurantId ) . then ( res => (
28
25
Object . entries ( seatsBooked ) . map ( i => ( {
You can’t perform that action at this time.
0 commit comments