mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 12:34:22 +08:00
fix: 看板SQL保存时自动去除尾部分号
This commit is contained in:
@@ -259,6 +259,8 @@ const resolveSqlTemplate = (sql: string) => {
|
||||
.join(formatIso(at(-30)))
|
||||
}
|
||||
|
||||
const trimSqlTailSemicolon = (sql: string) => sql.trimEnd().replace(/;+$/, "")
|
||||
|
||||
const parseNumber = (value: unknown): number | undefined => {
|
||||
if (typeof value === "number" && Number.isFinite(value)) return value
|
||||
if (typeof value === "string" && value.trim() !== "") {
|
||||
@@ -1258,7 +1260,15 @@ ORDER BY reward_points DESC, score DESC`,
|
||||
title={t("board.sqlEditorTitle")}
|
||||
open={Boolean(editingList)}
|
||||
onCancel={() => setEditingListId(null)}
|
||||
onOk={() => setEditingListId(null)}
|
||||
onOk={() => {
|
||||
if (editingList && activeBoard && canManage) {
|
||||
const nextSql = trimSqlTailSemicolon(editingList.sql)
|
||||
if (nextSql !== editingList.sql) {
|
||||
updateList(activeBoard.id, editingList.id, { sql: nextSql })
|
||||
}
|
||||
}
|
||||
setEditingListId(null)
|
||||
}}
|
||||
okText={t("common.confirm")}
|
||||
cancelText={t("common.cancel")}
|
||||
width={860}
|
||||
|
||||
Reference in New Issue
Block a user