Change fetch to our request utility function. (#12709)

This commit is contained in:
Nick Taylor 2021-02-17 10:37:05 -05:00 committed by GitHub
parent b98b68ecf6
commit 66e4747d3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,7 @@ import { ItemListItemArchiveButton } from './components/ItemListItemArchiveButto
import { ItemListLoadMoreButton } from './components/ItemListLoadMoreButton';
import { ItemListTags } from './components/ItemListTags';
import { Button } from '@crayons';
import { request } from '@utilities/http';
const STATUS_VIEW_VALID = 'valid,confirmed';
const STATUS_VIEW_ARCHIVED = 'archived';
@ -88,14 +89,9 @@ export class ReadingList extends Component {
event.preventDefault();
const { statusView, items, totalCount } = this.state;
window.fetch(`/reading_list_items/${item.id}`, {
request(`/reading_list_items/${item.id}`, {
method: 'PUT',
headers: {
'X-CSRF-Token': window.csrfToken,
'Content-Type': 'application/json',
},
body: JSON.stringify({ current_status: statusView }),
credentials: 'same-origin',
body: { current_status: statusView },
});
const t = this;