mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 04:57:18 +08:00
🐛 修复(ContentListAction.ts):修复插入内容时缺少category_id字段的问题
✨ 功能(ContentListAction.ts):将category_id作为参数传入插入内容的SQL语句
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
export default async ({request}) => {
|
||||
export default async ({request, params}) => {
|
||||
const formData = await request.formData()
|
||||
const cid = params.cid || 0
|
||||
switch(formData.get("action")){
|
||||
case "add":
|
||||
await window.api.sql(
|
||||
`insert into contents (title, content, created_at) values ('未命名', '', datetime())`,
|
||||
`insert into contents (title, content, category_id, created_at) values ('未命名', '', ${cid}, datetime())`,
|
||||
"create")
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user