20 lines
493 B
TypeScript
20 lines
493 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,
|
|
},
|
|
{ headers: { "x-api-token": "43c2e96e-af25-4467-9103-1479daa6288d" } }
|
|
);
|
|
return response.data;
|
|
} catch (error) {
|
|
console.error("Error creating query:", error);
|
|
throw error;
|
|
}
|
|
};
|