Dipolar interaction driven phase transitions in a one-dimensional optical lattice with a synthetic dimension