AE
Size: a a a
AE
IS
IS
PJ
NS
R
PJ
IS
IS
R
IS
IS
NS
var response = fetch('/wishlists', {я добавил еще 1 .then - почему он продолжает возвращать Promise?
method: 'POST',
body: JSON.stringify({
wishlist_title: title,
}),
headers: {"X-CSRFToken": csrftoken},
})
.then(responce => responce.json())
.then(data => data)
AE
var response = fetch('/wishlists', {я добавил еще 1 .then - почему он продолжает возвращать Promise?
method: 'POST',
body: JSON.stringify({
wishlist_title: title,
}),
headers: {"X-CSRFToken": csrftoken},
})
.then(responce => responce.json())
.then(data => data)
IS
IS
NS
async function CreateNewWishlist(csrftoken, title) {я добавил async-await, всеравно Promise..
var response = await fetch('/wishlists', {
method: 'POST',
body: JSON.stringify({
wishlist_title: title,
}),
headers: {"X-CSRFToken": csrftoken},
})
.then(responce => responce.json())
IS
G