Compare commits

..

2 commits

Author SHA1 Message Date
be6413aed8 Correct wrong field name 2025-06-10 21:23:05 +08:00
73603ca317 extend length 2025-06-10 21:22:17 +08:00
3 changed files with 4 additions and 5 deletions

View file

@ -29,7 +29,7 @@ const POST = z.object({
const Panel = () => { const Panel = () => {
const [posts, setPosts] = useState<z.infer<typeof POST>[]>([]) const [posts, setPosts] = useState<z.infer<typeof POST>[]>([])
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [verifyli, setVerifyli] = useState<{ id: number, ck: Boolean }[]>([]) const [verifyli, setVerifyli] = useState<{ post: number, check: Boolean }[]>([])
const load = () => { const load = () => {
setLoading(true) setLoading(true)
fetch(rootstr + "/api/admin/fetch_post", { credentials: "include" }).then(async val => { fetch(rootstr + "/api/admin/fetch_post", { credentials: "include" }).then(async val => {

View file

@ -2,7 +2,6 @@ package handlers
import ( import (
"bytes" "bytes"
"context"
"encoding/base64" "encoding/base64"
"image/png" "image/png"
"log" "log"
@ -187,7 +186,7 @@ func AdminVerify(c *fiber.Ctx) error {
if post_verify.Check { if post_verify.Check {
_, err = qtx.AdminVerify(ctx, nimdb.AdminVerifyParams{ID: post_verify.Id, Phase: nimdb.PostPhaseOk}) _, err = qtx.AdminVerify(ctx, nimdb.AdminVerifyParams{ID: post_verify.Id, Phase: nimdb.PostPhaseOk})
if err != nil { if err != nil {
log.Println(err.Error()) log.Println(err.Error(), post_verify.Id)
return c.SendStatus(fiber.StatusBadRequest) return c.SendStatus(fiber.StatusBadRequest)
} }
@ -214,7 +213,7 @@ func AdminVerify(c *fiber.Ctx) error {
if post_verify.Check { if post_verify.Check {
_, err = qtx.SuperAdminVerify(ctx, nimdb.SuperAdminVerifyParams{ID: post_verify.Id, Phase: nimdb.PostPhaseOk}) _, err = qtx.SuperAdminVerify(ctx, nimdb.SuperAdminVerifyParams{ID: post_verify.Id, Phase: nimdb.PostPhaseOk})
if err != nil { if err != nil {
log.Println(err.Error()) log.Println(err.Error(), post_verify.Id)
return c.SendStatus(fiber.StatusBadRequest) return c.SendStatus(fiber.StatusBadRequest)
} }

View file

@ -2,7 +2,7 @@ CREATE TYPE post_phase AS ENUM('pending', 'rejected', 'admin_rejected','ok', 'de
CREATE TABLE posts ( CREATE TABLE posts (
id serial PRIMARY KEY, id serial PRIMARY KEY,
content varchar(200) not null, content varchar(500) not null,
signing varchar(20), signing varchar(20),
hash char(64) UNIQUE NOT NULL, hash char(64) UNIQUE NOT NULL,
post_at timestamp with time zone DEFAULT now(), post_at timestamp with time zone DEFAULT now(),