Add 'sge-frontend/' from commit '5fa787e054b25ac53edc7ff0275ea7960a709401'

git-subtree-dir: sge-frontend
git-subtree-mainline: 876c278ac4
git-subtree-split: 5fa787e054
This commit is contained in:
2025-08-04 00:27:23 +03:00
337 changed files with 854877 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
import axiosConf, {baseURL} from "../configs/@axios";
import axios from "axios";
class ApplicationService {
get url() {
return process.env.REACT_APP_API_BASE_URL;
};
get webSocketUrl() {
return process.env.REACT_APP_API_WEBSOCKET_BASE_URL;
};
http = () => {
return axiosConf;
};
httpWithoutAuthorization = () => {
return axios.create({
baseURL,
});
}
get = (url) => {
return new Promise((resolve, reject) => {
return this.http()
.get(url)
.then((data) => {
resolve(data.data);
})
.catch((err) => {
reject(err);
});
});
};
post = (url, data, config) => {
return new Promise((resolve, reject) => {
return this.http()
.post(url, data, config)
.then((data) => {
resolve(data.data);
})
.catch((err) => {
reject(err);
});
});
};
put = (url, data, config) => {
return new Promise((resolve, reject) => {
return this.http()
.put(url, data, config)
.then((data) => {
resolve(data.data);
})
.catch((err) => {
reject(err);
});
});
};
delete = (url) => {
return new Promise((resolve, reject) => {
return this.http()
.delete(url)
.then((data) => {
resolve(data.data);
})
.catch((err) => {
reject(err);
});
});
};
}
const instance = new ApplicationService();
export default instance;

View File

@@ -0,0 +1 @@
export * from './ApplicationService';