ui: display invalid credentials error for integrations

This commit is contained in:
nick-delirium 2024-11-15 11:38:09 +01:00
parent 11d4b168a1
commit 08329ed3a0
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -81,7 +81,11 @@ export async function saveIntegration<T>(
return r.ok;
} catch (e) {
console.error(e);
toast.error(`Failed to save ${name} integration`);
if (e.response.status === 422) {
toast.error(`Invalid credentials for ${name}`);
} else {
toast.error(`Failed to save ${name} integration`);
}
}
}