Updated js to get records by params and delete by params