16 lines
391 B
TypeScript
16 lines
391 B
TypeScript
import axios from "axios";
|
|
import { config } from "../config";
|
|
|
|
export default async (project: { token: string }, source: string) => {
|
|
try {
|
|
const response = await axios.post(`${config.url}/query/create`, {
|
|
source,
|
|
projectToken: project.token,
|
|
});
|
|
return response.data;
|
|
} catch (error) {
|
|
console.error("Error creating query:", error);
|
|
throw error;
|
|
}
|
|
};
|