Extracted repeated code into a onDeleteClick functionin the Create Survey logic