fix linting errors

This commit is contained in:
einhornimmond 2021-03-30 13:44:26 +02:00
parent 1e4ba146ac
commit 28c0bc0966
2 changed files with 11 additions and 13 deletions

View File

@ -9,17 +9,16 @@ const EMAIL_TYPE = {
const apiGet = async (url) => {
try {
const result = await axios.get(url);
if(result.status !== 200){
throw new Error('HTTP Status Error '+result.status)
const result = await axios.get(url)
if (result.status !== 200) {
throw new Error('HTTP Status Error ' + result.status)
}
if(result.data.state !== 'success'){
if (result.data.state !== 'success') {
throw new Error(result.data.msg)
}
return { success: true, result }
} catch(error){
return { success: false, result: error}
} catch (error) {
return { success: false, result: error }
}
}
@ -29,11 +28,10 @@ const apiPost = async (url, payload) => {
if (result.status !== 200) {
throw new Error('HTTP Status Error ' + result.status)
}
if(result.data.state === 'warning') {
if (result.data.state === 'warning') {
return { success: true, result: error }
}
if(result.data.state !== 'success'){
if (result.data.state !== 'success') {
throw new Error(result.data.msg)
}
return { success: true, result }

2
gn

@ -1 +1 @@
Subproject commit a61871987261614102b11ed58791081be1954d3c
Subproject commit 5437e2f882c54efe4f501f7cd0d97f53806d0b74