数据库文档编写,开发规范文档,数据库接入
This commit is contained in:
@@ -29,6 +29,7 @@ function safeString(v: any): string {
|
||||
|
||||
// 改造:不再直查 analytics_reports 表,统一通过 RPC 获取当前用户的报表列表
|
||||
export async function listCustomReports(ownerUserId: string): Promise<Array<CustomReportListItem>> {
|
||||
// rpc_get_custom_reports 基于 auth.uid() 过滤,无需额外参数,这里保留签名用于兼容调用方
|
||||
const rows = await rpcOrEmptyArray('rpc_get_custom_reports', {} as any)
|
||||
const list: Array<CustomReportListItem> = []
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
@@ -37,8 +38,7 @@ export async function listCustomReports(ownerUserId: string): Promise<Array<Cust
|
||||
id: safeString(r.getAny?.('id') ?? r.getString?.('id')),
|
||||
title: safeString(r.getAny?.('title') ?? r.getString?.('title')),
|
||||
description: safeString(r.getAny?.('description') ?? r.getString?.('description')),
|
||||
// 兼容旧 UI 字段:custom-report 页面里可能还在用 period 字段
|
||||
period: '',
|
||||
period: safeString(r.getAny?.('period') ?? r.getString?.('period')),
|
||||
updated_at: safeString(r.getAny?.('updated_at') ?? r.getString?.('updated_at'))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user