统一前后端代码格式化配置
This commit is contained in:
@@ -39,7 +39,9 @@ type AdminAuditLogListResult = {
|
||||
total: number
|
||||
}
|
||||
|
||||
export async function createAdminAuditLog(input: AdminAuditLogCreateInput): Promise<AdminAuditLogRow | null> {
|
||||
export async function createAdminAuditLog(
|
||||
input: AdminAuditLogCreateInput,
|
||||
): Promise<AdminAuditLogRow | null> {
|
||||
const result = await query<AdminAuditLogRow>(
|
||||
`
|
||||
INSERT INTO admin_audit_logs (
|
||||
@@ -69,12 +71,19 @@ export async function createAdminAuditLog(input: AdminAuditLogCreateInput): Prom
|
||||
return result.rows[0] || null
|
||||
}
|
||||
|
||||
export async function getAdminAuditLogById(logId: number | string): Promise<AdminAuditLogRow | null> {
|
||||
const result = await query<AdminAuditLogRow>('SELECT * FROM admin_audit_logs WHERE id = $1 LIMIT 1', [Number(logId)])
|
||||
export async function getAdminAuditLogById(
|
||||
logId: number | string,
|
||||
): Promise<AdminAuditLogRow | null> {
|
||||
const result = await query<AdminAuditLogRow>(
|
||||
'SELECT * FROM admin_audit_logs WHERE id = $1 LIMIT 1',
|
||||
[Number(logId)],
|
||||
)
|
||||
return result.rows[0] || null
|
||||
}
|
||||
|
||||
export async function listAdminAuditLogs(queryInput: AdminAuditLogListInput = {}): Promise<AdminAuditLogListResult> {
|
||||
export async function listAdminAuditLogs(
|
||||
queryInput: AdminAuditLogListInput = {},
|
||||
): Promise<AdminAuditLogListResult> {
|
||||
const conditions: string[] = []
|
||||
const params: unknown[] = []
|
||||
|
||||
@@ -108,7 +117,7 @@ export async function listAdminAuditLogs(queryInput: AdminAuditLogListInput = {}
|
||||
const pageSize = Number(queryInput.pageSize) || 20
|
||||
const offset = (page - 1) * pageSize
|
||||
|
||||
const totalResult = await query<{ [column: string]: unknown, total: number }>(
|
||||
const totalResult = await query<{ [column: string]: unknown; total: number }>(
|
||||
`SELECT COUNT(*)::int AS total FROM admin_audit_logs ${whereClause}`,
|
||||
params,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user