mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
fix UI no data show default value
This commit is contained in:
@@ -36,13 +36,17 @@ const Configuration = () => {
|
|||||||
const obj = {
|
const obj = {
|
||||||
rateLimit: {}
|
rateLimit: {}
|
||||||
}
|
}
|
||||||
|
const rateLimitValuesBoolean = [!limitMax, !limitDuration, !limitMsg]
|
||||||
if (limitMax && limitDuration && limitMsg)
|
const rateLimitFilledValues = rateLimitValuesBoolean.filter((value) => value === false)
|
||||||
|
if (rateLimitFilledValues.length >= 1 && rateLimitFilledValues.length <= 2) {
|
||||||
|
throw new Error('Need to fill all rate limit input fields')
|
||||||
|
} else if (rateLimitFilledValues.length === 3) {
|
||||||
obj.rateLimit = {
|
obj.rateLimit = {
|
||||||
limitMax,
|
limitMax,
|
||||||
limitDuration,
|
limitDuration,
|
||||||
limitMsg
|
limitMsg
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
@@ -69,7 +73,9 @@ const Configuration = () => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
const errorData = error.response.data || `${error.response.status}: ${error.response.statusText}`
|
const errorData = error.response
|
||||||
|
? error.response.data || `${error.response.status}: ${error.response.statusText}`
|
||||||
|
: error.message
|
||||||
enqueueSnackbar({
|
enqueueSnackbar({
|
||||||
message: `Failed to save API Configuration: ${errorData}`,
|
message: `Failed to save API Configuration: ${errorData}`,
|
||||||
options: {
|
options: {
|
||||||
|
|||||||
Reference in New Issue
Block a user