Update LiveEditor

pull/880/head
Tuğçe Küçükoğlu 2021-01-21 16:53:02 +03:00
parent 478ef5b991
commit b6cb589f81
2 changed files with 25 additions and 11 deletions

View File

@ -511,23 +511,33 @@ img.flag {
`,
}
if (this.service && this.data) {
const dataArr = this.data.split(',');
if (this.service) {
const dataArr = this.data ? this.data.split(',') : null;
dataArr.forEach(el => {
_files[`public/data/${el}.json`] = {
content: data[el]
};
if(dataArr) {
dataArr.forEach(el => {
_files[`public/data/${el}.json`] = {
content: data[el]
};
_files[`src/service/${this.service}.js`] = {
// content: services[this.service]
content: `import axios from 'axios';
_files[`src/service/${this.service}.js`] = {
content: `import axios from 'axios';
import data from '../../public/data/${el}.json';
${services[this.service]}
`
};
});
};
});
}
else {
_files[`src/service/${this.service}.js`] = {
content: `import axios from 'axios';
${services[this.service]}
`
};
}
extDependencies['axios'] = "^0.19.0";

View File

@ -25,6 +25,10 @@ export default class CustomerService {
getCustomersXLarge() {
return axios.get(data).then(res => res.config.url.data);
}
getCustomers(params) {
return axios.get('https://www.primefaces.org/data/customers', { params }).then(res => res.data)
}
}
`,
'EventService': `