Skip to content

Commit

Permalink
Fix FDL EGI error
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioLangaritaBenitez committed Feb 2, 2024
1 parent 1d2acf8 commit 8166456
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/components/forms/FDLForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,22 @@ export default {
}
var params=this.prepareFunction()
const response = await fetch(this.api+'/system/services',options);
const json = await response.json();
let result = json.map(service => service.name);
if (response != null){
const json = await response.json();
let result = json.map(service => service.name);
}else{
options.method="PUT"
var typecall="created"
}
for (let index = 0; index < params.length; index++) {
if(result.includes(params[index].name)){
options.method="PUT"
var typecall="created"
}else{
options.method="POST"
var typecall="edited"
if (response != null){
if( result.includes(params[index].name)){
options.method="PUT"
var typecall="created"
}else{
options.method="POST"
var typecall="edited"
}
}
options.body= JSON.stringify(params[index])
const response = await fetch(this.api+'/system/services',options);
Expand Down

0 comments on commit 8166456

Please sign in to comment.