-
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
@chlenc Can you:
@deekerno We should really create an |
Beta Was this translation helpful? Give feedback.
-
@ra0x3 Hi, excuse me for the weak description, let me fix that.
2.1 Trying using a request with a headers 2.2 Trying to get data from the indexer in the frontend side using a request with a no-cors mode, but this mode resets headers and makes
Repo: https://github.com/chlenc/indexer-test-frontend |
Beta Was this translation helpful? Give feedback.
-
And the same error is in the console of deployed app https://chlenc.github.io/indexer-test-frontend/ |
Beta Was this translation helpful? Give feedback.
-
We likely need to add |
Beta Was this translation helpful? Give feedback.
-
Huh, TIL. I'll put up a PR for this. |
Beta Was this translation helpful? Give feedback.
-
@chlenc Can you pull down the |
Beta Was this translation helpful? Give feedback.
-
@deekerno I ran the indexer from your branch locally
And after that deployed the spark indexer
|
Beta Was this translation helpful? Give feedback.
-
import React, { useEffect } from "react";
import logo from "./logo.svg";
import "./App.css";
import axios from "axios";
function App() {
useEffect(() => {
const response = axios.request({
method: "POST",
url: "https://spark-indexer.spark-defi.com/api/sql/swaygang/spark_indexer",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
data: {
query:
"SELECT json_agg(t) FROM (SELECT * FROM swaygang_spark_indexer.orderentity WHERE status = 'Active' AND asset0 = '17e68049bb3cf21a85f00778fde367465bbd8263e8d4f8e47e533fe0df865658' AND asset1 = 'eaa756f320f175f0023a8c9fc2c9b7a03ce8d715f04ac49aba69d2b7d74e70b8') t;",
},
});
});
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}
export default App; |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot ❤️ |
Beta Was this translation helpful? Give feedback.
-
I'm starting the release process right now! It should be only a few hours to get all the crates published and the new release available in |
Beta Was this translation helpful? Give feedback.
-
Thank you so much, you sirs made my day better, I really appreciate it ❤️✨ |
Beta Was this translation helpful? Give feedback.
@chlenc
We do have a bug, I've updated @deekerno's PR to allow for all headers and more methods
Also, there are some issues in your React code
Below is a more simple version that includes proper headers