mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Sending cookies with fetch, bg color change
This commit is contained in:
parent
9f576a41f6
commit
cbba4cd616
10 changed files with 21 additions and 11 deletions
|
@ -16,7 +16,9 @@ export default function Index (props) {
|
|||
|
||||
useEffect(() => {
|
||||
console.info('Fetching news.json')
|
||||
fetch(`${constants.apiUrl}news.json`) // eslint-disable-line
|
||||
fetch(`${constants.apiUrl}news.json`, {
|
||||
credentials: 'include'
|
||||
})
|
||||
.then((resp) => {
|
||||
return resp.json()
|
||||
})
|
||||
|
@ -27,7 +29,9 @@ export default function Index (props) {
|
|||
|
||||
useEffect(() => {
|
||||
console.info('Fetching data')
|
||||
fetch(`${constants.apiUrl}motd`)
|
||||
fetch(`${constants.apiUrl}motd`, {
|
||||
credentials: 'include'
|
||||
})
|
||||
.then((resp) => {
|
||||
return resp.text()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue