Skip to content

Commit 899e167

Browse files
mansonaTurbo87
authored andcommitted
utils/ajax: Use native fetch() function
1 parent 209ccc9 commit 899e167

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/utils/ajax.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { runInDebug } from '@ember/debug';
2-
3-
import fetch from 'fetch';
2+
import { waitForPromise } from '@ember/test-waiters';
43

54
export default async function ajax(input, init) {
65
let method = init?.method ?? 'GET';
76

87
let cause;
98
try {
10-
let response = await fetch(input, init);
9+
let response = await waitForPromise(fetch(input, init));
1110
if (response.ok) {
1211
return await response.json();
1312
}

0 commit comments

Comments
 (0)