fix: use null instead of empty string for flag filter initial value
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

Axios sends empty string as query param which fails django-ninja
Literal validation. Null is omitted from params entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 18:15:35 +08:00
parent 0ee8b0d6ea
commit 016e070fb9

View File

@@ -151,7 +151,7 @@ const count = ref(0)
const query = reactive({ const query = reactive({
page: Number(route.params.page), page: Number(route.params.page),
username: route.query.username ?? "", username: route.query.username ?? "",
flag: "" as string, flag: null as string | null,
}) })
const html = computed(() => submission.value.html) const html = computed(() => submission.value.html)
@@ -221,7 +221,7 @@ async function showChain(conversationId: string) {
const columns: DataTableColumn<SubmissionOut>[] = [ const columns: DataTableColumn<SubmissionOut>[] = [
{ {
title: "标记", title: "",
key: "flag", key: "flag",
width: 50, width: 50,
render: (row) => { render: (row) => {
@@ -274,6 +274,7 @@ const columns: DataTableColumn<SubmissionOut>[] = [
NButton, NButton,
{ {
text: true, text: true,
block: true,
type: "error", type: "error",
onClick: () => updateFlag(row, null), onClick: () => updateFlag(row, null),
}, },