DB
This commit is contained in:
@ -1,14 +1,12 @@
|
||||
import axios from "axios";
|
||||
import { config } from "tests/config";
|
||||
|
||||
export default async (query: { id: string }, module: { id: string }) => {
|
||||
try {
|
||||
const response = await axios.post(
|
||||
"http://localhost:3000/query/module/add",
|
||||
{
|
||||
queryId: query.id,
|
||||
moduleId: module.id,
|
||||
}
|
||||
);
|
||||
const response = await axios.post(`${config.url}/query/module/add`, {
|
||||
queryId: query.id,
|
||||
moduleId: module.id,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
import axios from "axios";
|
||||
import { config } from "tests/config";
|
||||
|
||||
export default async (query: { id: string }, plugin: { id: string }) => {
|
||||
try {
|
||||
const response = await axios.post(
|
||||
"http://localhost:3000/query/plugin/add",
|
||||
{
|
||||
queryId: query.id,
|
||||
pluginId: plugin.id,
|
||||
}
|
||||
);
|
||||
const response = await axios.post(`${config.url}/query/plugin/add`, {
|
||||
queryId: query.id,
|
||||
pluginId: plugin.id,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
import axios from "axios";
|
||||
import { config } from "tests/config";
|
||||
|
||||
export default async (name: string, sourcePath: string) => {
|
||||
try {
|
||||
const response = await axios.post(
|
||||
"http://localhost:3000/query/module/create",
|
||||
{
|
||||
name,
|
||||
sourcePath,
|
||||
}
|
||||
);
|
||||
const response = await axios.post(`${config.url}/query/module/create`, {
|
||||
name,
|
||||
sourcePath,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
import axios from "axios";
|
||||
import { config as appConfig } from "../config";
|
||||
|
||||
export default async (name: string, className: string, config: string) => {
|
||||
try {
|
||||
const response = await axios.post(
|
||||
"http://localhost:3000/query/plugin/create",
|
||||
{
|
||||
name,
|
||||
class: className,
|
||||
config,
|
||||
}
|
||||
);
|
||||
const response = await axios.post(`${appConfig.url}/query/plugin/create`, {
|
||||
name,
|
||||
class: className,
|
||||
config,
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import axios from "axios";
|
||||
import { config } from "../config";
|
||||
|
||||
const createProject = async (name: string) => {
|
||||
try {
|
||||
const response = await axios.put("http://localhost:3000/project/create", {
|
||||
const response = await axios.put(`${config.url}/project/create`, {
|
||||
name: name,
|
||||
});
|
||||
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import axios from "axios";
|
||||
import { config } from "../config";
|
||||
|
||||
export default async (project: { token: string }, source: string) => {
|
||||
try {
|
||||
const response = await axios.post("http://localhost:3000/query/create", {
|
||||
const response = await axios.post(`${config.url}/query/create`, {
|
||||
source,
|
||||
projectToken: project.token,
|
||||
});
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import axios from "axios";
|
||||
import { config } from "../config";
|
||||
|
||||
export default async (token: string, queryData: Record<string, any>) => {
|
||||
try {
|
||||
const response = await axios.post(
|
||||
`http://localhost:3000/query/run/${token}`,
|
||||
`${config.url}/query/run/${token}`,
|
||||
queryData
|
||||
);
|
||||
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import axios from "axios";
|
||||
import { config } from "../config";
|
||||
|
||||
export default async (query: { id: string; source: string }) => {
|
||||
try {
|
||||
const response = await axios.post("http://localhost:3000/query/update", {
|
||||
const response = await axios.post(`${config.url}/query/update`, {
|
||||
queryId: query.id,
|
||||
source: query.source,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user