mirror of
https://github.com/yuruotong1/autoMate.git
synced 2025-12-26 05:16:21 +08:00
15 lines
471 B
TypeScript
15 lines
471 B
TypeScript
import { useNavigate } from "react-router-dom"
|
|
|
|
export default () => {
|
|
const navigate = useNavigate()
|
|
const updateContentCategory = async(id: number, category_id: number) => {
|
|
await window.api.sql(
|
|
`UPDATE contents set category_id=@category_id WHERE id=@id`,
|
|
"update",
|
|
{category_id, id}
|
|
)
|
|
navigate(`/config/category/contentList/${category_id}/content/${id}`)
|
|
|
|
}
|
|
return {updateContentCategory}
|
|
} |