8000 Feat: Add fetchQuery Function · PrashanthaTP/leetcode-client@5946701 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5946701

Browse files
committed
Feat: Add fetchQuery Function
1 parent 1d72b9d commit 5946701

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/requests.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import axios from "axios";
2+
import config from "../config/config";
3+
4+
export const fetchQuery = async (query) => {
5+
const data = await axios({
6+
url: "http://localhost:8000/api/v1/query",
7+
method: "POST",
8+
data: {
9+
LEETCODE_SESSION: config.env.LEETCODE_SESSION,
10+
CSRFTOKEN: config.env.CSRFTOKEN,
11+
queryData: query,
12+
},
13+
});
14+
return data.data.data;
15+
};
16+
export default { fetchQuery };

0 commit comments

Comments
 (0)
0