if @endpoint.save
        RefreshEndpointWorker.perform_async RefreshSubmission.new(@endpoint.id)

        format.html { redirect_to root_url, notice: 'Endpoint was successfully created.' }
        format.json { head :created }