mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
add group not found error message #11
This commit is contained in:
@@ -47,5 +47,13 @@ export function displayEvents({ data, document, list }) {
|
||||
|
||||
export function displayErrorMessage({ data, list }) {
|
||||
console.error(data)
|
||||
list.children[0].style.display = 'block'
|
||||
if (Object.prototype.hasOwnProperty.call(data, 'response') &&
|
||||
Object.prototype.hasOwnProperty.call(data.response, 'errors') &&
|
||||
data.response.errors.length > 0 &&
|
||||
Object.prototype.hasOwnProperty.call(data.response.errors[0], 'code') &&
|
||||
data.response.errors[0].code === 'group_not_found') {
|
||||
list.children[1].style.display = 'block'
|
||||
} else {
|
||||
list.children[0].style.display = 'block'
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user