Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 8244255

Browse files
committed
Define data with json converted response body
1 parent 82f941b commit 8244255

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/addons.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ async function deleteAddon(settings, netlifyApiToken) {
5959
})
6060

6161
if (response.status === 422) {
62+
const data = await response.json()
6263
throw new Error(`Error ${JSON.stringify(data)}`)
6364
}
6465

@@ -81,6 +82,8 @@ async function updateAddon(settings, netlifyApiToken) {
8182
}),
8283
})
8384

85+
const data = await response.json()
86+
8487
if (response.status === 422) {
8588
throw new Error(`Error ${JSON.stringify(data)}`)
8689
}

0 commit comments

Comments
 (0)