Do not send error json to backend - it doesn’t need it and it creates bad data

This commit is contained in:
Paul Chavard 2018-11-27 11:31:03 +01:00
parent 3915d2a579
commit f2e7feec1d
3 changed files with 3 additions and 3 deletions

View file

@ -28,7 +28,7 @@ class Champs::CarteController < ApplicationController
geo_areas = []
geo_json = geo_json.blank? ? [] : JSON.parse(geo_json)
if geo_json.first == ["error", "TooManyPolygons"]
if geo_json.empty?
@error = true
@champ.value = nil
@champ.geo_areas = []