1
0
Fork 0
mirror of synced 2024-07-07 23:35:49 +12:00

prevent lack of start/end date from causing UI error

This commit is contained in:
Martin McKeaveney 2024-05-08 15:55:14 +01:00
parent 1d300c2577
commit dacb0d30ce
2 changed files with 15 additions and 7 deletions

View file

@ -2,7 +2,7 @@
apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "budibase.fullname" . }}-apps
name: {{ include "budibase.fullname" . }}-automation-worker
labels:
{{- include "budibase.labels" . | nindent 4 }}
spec:

View file

@ -98,14 +98,22 @@
})
}
async function fetchBackups(filters, page, dateRange) {
const response = await backups.searchBackups({
async function fetchBackups(filters, page, dateRange = []) {
const body = {
appId: $appStore.appId,
...filters,
page,
startDate: dateRange[0],
endDate: dateRange[1],
})
}
const [startDate, endDate] = dateRange
if (startDate) {
body.startDate = startDate
}
if (endDate) {
body.endDate = endDate
}
const response = await backups.searchBackups(body)
pageInfo.fetched(response.hasNextPage, response.nextPage)
// flatten so we have an easier structure to use for the table schema
@ -120,7 +128,7 @@
})
await fetchBackups(filterOpt, page)
notifications.success(response.message)
} catch {
} catch (err) {
notifications.error("Unable to create backup")
}
}