We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1fd066 commit 49ae904Copy full SHA for 49ae904
1 file changed
src/app/Services/Hostelworld/Api/AvailabilityClient.ts
@@ -112,9 +112,12 @@ export class AvailabilityClient {
112
availability: HostelworldPropertyAvailability
113
): void {
114
for (const dorm of availability.rooms.dorms) {
115
+ const capacity: number = Number(dorm.capacity)
116
+ if (!capacity) continue
117
+
118
dorm.totalBedsAvailable = Math.ceil(
- dorm.totalBedsAvailable / Number(dorm.capacity)
- ) * Number(dorm.capacity)
119
+ dorm.totalBedsAvailable / capacity
120
+ ) * capacity
121
}
122
123
0 commit comments