.then(res => { if (!res.data) { return api.post('users', { username: this.user, name: this.user, stores: [], filters: [] }); } else { return res; } })
handleSubmit(storeData) { api.post('stores', storeData) .then((res) => { console.log(res); return this.callback(); }) .catch((error) => { console.log(error); }); this.handleClose(); }
handleSubmit(adData) { api.post('marketing/ads', adData) .then((res) => { console.log(res); return this.callback(); }) .catch((error) => { console.log(error); }); this.handleClose(); }