This commit is contained in:
2023-05-24 15:10:34 +03:00
parent 5f09fa2490
commit 8ddf1aef53
5 changed files with 12 additions and 10 deletions

View File

@ -15,7 +15,7 @@ const Snippet = ({ id }) => {
const { authTokens } = useContext(AuthContext);
const [ snippet, setSnippet ] = useState("");
const getSnippet = async (id) => {
const response = await fetch(`http://127.0.0.1/api/snippets/${id}`, {
const response = await fetch(`http://${process.env.REACT_APP_DOMAIN}/api/snippets/${id}`, {
method: "GET",
headers: {
"Authorization": `Bearer ${authTokens.access}`,
@ -31,7 +31,7 @@ const Snippet = ({ id }) => {
}
};
const updateSnippet = async (id, snippet) => {
const response = await fetch(`http://127.0.0.1/api/snippets/${id}`, {
const response = await fetch(`http://${process.env.REACT_APP_DOMAIN}/api/snippets/${id}`, {
method: "POST",
headers: {
"Authorization": `Bearer ${authTokens.access}`,