all 7 methods in 6-server.js (build/debug/run/clear/stop/destroy/library) are literlly copy-paste with different URLs:
const toastId = toast.info('LOADING.......');
dispatcher({ type: T.SET_LOGS, payload: false });
Axios.post(url)
.then(res => {
toast.success(res.data['message']);
dispatcher({ type: T.SET_FUNCTIONS, payload: {...} });
toast.dismiss(toastId);
})
.catch(err => {
toast.error(err.response?.data?.message || err.message);
toast.dismiss(toastId);
});
if (this.serverID); // ???
Fix one bug, gotta manually fix 6 more, already caused issues (see #297)
fix can be, Extract shared helper like _serverAction(method, url, successPayload). Refactor all methods to use it. Kill the useless if (this.serverID);
all 7 methods in 6-server.js (build/debug/run/clear/stop/destroy/library) are literlly copy-paste with different URLs:
Fix one bug, gotta manually fix 6 more, already caused issues (see #297)
fix can be, Extract shared helper like _serverAction(method, url, successPayload). Refactor all methods to use it. Kill the useless if (this.serverID);