feat: save active tabs in dashboard permalink (#19983)

This commit is contained in:
Jesse Yang
2022-06-29 09:43:52 -07:00
committed by GitHub
parent c5d3678a31
commit cadd259788
17 changed files with 274 additions and 103 deletions

View File

@@ -50,10 +50,15 @@ export function parseErrorJson(responseObject: JsonObject): ClientErrorObject {
}
// Marshmallow field validation returns the error mssage in the format
// of { message: { field1: [msg1, msg2], field2: [msg], } }
if (error.message && typeof error.message === 'object' && !error.error) {
error.error =
Object.values(error.message as Record<string, string[]>)[0]?.[0] ||
t('Invalid input');
if (!error.error && error.message) {
if (typeof error.message === 'object') {
error.error =
Object.values(error.message as Record<string, string[]>)[0]?.[0] ||
t('Invalid input');
}
if (typeof error.message === 'string') {
error.error = error.message;
}
}
if (error.stack) {
error = {