fix(api): normalize empty list responses

This commit is contained in:
zetaloop
2026-04-26 01:53:05 +08:00
parent 904148bd55
commit 30c336345e
11 changed files with 28 additions and 23 deletions
+7 -4
View File
@@ -65,8 +65,11 @@ export async function applyCurrentUserVerification(input: {
}
export async function listCurrentUserVerifications(): Promise<VerificationRecord[]> {
const res = await httpJson<{ list: VerificationRecord[] }>("/api/v1/users/me/verification", {
cache: "no-store",
})
return res.list
const res = await httpJson<{ list: VerificationRecord[] | null }>(
"/api/v1/users/me/verification",
{
cache: "no-store",
},
)
return res.list ?? []
}