Cannot we just use  data:{"type": newType}