feat: enhance API and query handling with Redis caching; add QueryGuard for query validation; refactor services to utilize RedisClient for improved performance
This commit is contained in:
@ -3,10 +3,14 @@ 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,
|
||||
});
|
||||
const response = await axios.post(
|
||||
`${config.url}/query/create`,
|
||||
{
|
||||
source,
|
||||
projectToken: project.token,
|
||||
},
|
||||
{ headers: { "x-api-token": "efbeccd6-dde1-47dc-b3aa-4fbd773d5429" } }
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error("Error creating query:", error);
|
||||
|
||||
@ -5,7 +5,8 @@ export default async (token: string, queryData: Record<string, any>) => {
|
||||
try {
|
||||
const response = await axios.post(
|
||||
`${config.url}/query/run/${token}`,
|
||||
queryData
|
||||
queryData,
|
||||
{ headers: { "x-api-token": "efbeccd6-dde1-47dc-b3aa-4fbd773d5429" } }
|
||||
);
|
||||
|
||||
return response;
|
||||
|
||||
Reference in New Issue
Block a user