upd: list app

This commit is contained in:
2026-04-15 14:19:10 +08:00
parent c67fc9a230
commit 16ea551b4c
2 changed files with 20 additions and 10 deletions

View File

@@ -68,6 +68,12 @@ function AppErrorsPage() {
fetch(API_URLS.getBugs(page, search, app, status)).then((r) => r.json()),
})
// Fetch apps for the dropdown
const { data: appsList } = useQuery({
queryKey: ['apps-list'],
queryFn: () => fetch('/api/apps').then((r) => r.json()),
})
// Create Bug Modal Logic
const [opened, { open, close }] = useDisclosure(false)
const [isSubmitting, setIsSubmitting] = useState(false)
@@ -344,12 +350,11 @@ function AppErrorsPage() {
<SimpleGrid cols={2}>
<Select
label="Application"
data={[
{ value: 'desa-plus', label: 'Desa+' },
{ value: 'hipmi', label: 'Hipmi' },
]}
data={appsList?.map((a: any) => ({ value: a.id, label: a.name })) || []}
value={createForm.app}
onChange={(val) => setCreateForm({ ...createForm, app: val as any })}
placeholder="Select application"
disabled={!appsList}
/>
<Select
label="Source"