I misunderstood Promise.all in JavaScript