Compare commits
2 commits
f19f26b9f6
...
be6413aed8
Author | SHA1 | Date | |
---|---|---|---|
be6413aed8 | |||
73603ca317 |
3 changed files with 4 additions and 5 deletions
|
@ -29,7 +29,7 @@ const POST = z.object({
|
|||
const Panel = () => {
|
||||
const [posts, setPosts] = useState<z.infer<typeof POST>[]>([])
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [verifyli, setVerifyli] = useState<{ id: number, ck: Boolean }[]>([])
|
||||
const [verifyli, setVerifyli] = useState<{ post: number, check: Boolean }[]>([])
|
||||
const load = () => {
|
||||
setLoading(true)
|
||||
fetch(rootstr + "/api/admin/fetch_post", { credentials: "include" }).then(async val => {
|
||||
|
|
|
@ -2,7 +2,6 @@ package handlers
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"image/png"
|
||||
"log"
|
||||
|
@ -187,7 +186,7 @@ func AdminVerify(c *fiber.Ctx) error {
|
|||
if post_verify.Check {
|
||||
_, err = qtx.AdminVerify(ctx, nimdb.AdminVerifyParams{ID: post_verify.Id, Phase: nimdb.PostPhaseOk})
|
||||
if err != nil {
|
||||
log.Println(err.Error())
|
||||
log.Println(err.Error(), post_verify.Id)
|
||||
return c.SendStatus(fiber.StatusBadRequest)
|
||||
}
|
||||
|
||||
|
@ -214,7 +213,7 @@ func AdminVerify(c *fiber.Ctx) error {
|
|||
if post_verify.Check {
|
||||
_, err = qtx.SuperAdminVerify(ctx, nimdb.SuperAdminVerifyParams{ID: post_verify.Id, Phase: nimdb.PostPhaseOk})
|
||||
if err != nil {
|
||||
log.Println(err.Error())
|
||||
log.Println(err.Error(), post_verify.Id)
|
||||
return c.SendStatus(fiber.StatusBadRequest)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ CREATE TYPE post_phase AS ENUM('pending', 'rejected', 'admin_rejected','ok', 'de
|
|||
|
||||
CREATE TABLE posts (
|
||||
id serial PRIMARY KEY,
|
||||
content varchar(200) not null,
|
||||
content varchar(500) not null,
|
||||
signing varchar(20),
|
||||
hash char(64) UNIQUE NOT NULL,
|
||||
post_at timestamp with time zone DEFAULT now(),
|
||||
|
|
Loading…
Add table
Reference in a new issue