Change fetch to our request utility function. (#12709)
This commit is contained in:
parent
b98b68ecf6
commit
66e4747d3f
1 changed files with 3 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue