I'm trying to apply edits on a layer that i fetch through a ESRIRequest action.
Basically, I'm fetching the layer like this and trying to apply my edits with 'then' :
url = https://somewebsite/rest/services/app/app1/FeatureServer/applyEdits
let newAcc = {
"attributes": {dataFeatureAcc}
}
request(url).then(function (response) {
response.data.applyEdits: [newAcc]
});
This used to work withtout the request, but I'm required to use it. I found the documentation but don't find it usefull as it only shows the data structure that the edited features should have. It doesn't show how to apply the edits. Can someone help me out ? Many thanks.
Solved! Go to Solution.
@Anonymous User
The applyEdits method is present on the FeatureLayer class. Currently your code is attempting to execute that method on a array of Graphics. You need to instantiate a FeatureLayer class from your URL and call the load method (assuming that you are not loading that FeatureLayer class to the map Then you can call the FeatureLayer class applyEdits method.
@Anonymous User
The applyEdits method is present on the FeatureLayer class. Currently your code is attempting to execute that method on a array of Graphics. You need to instantiate a FeatureLayer class from your URL and call the load method (assuming that you are not loading that FeatureLayer class to the map Then you can call the FeatureLayer class applyEdits method.