Compare commits

..

No commits in common. "be6413aed825eed29224c992033bd8250809e2e6" and "f19f26b9f6fdf04e337362c94ffb32e3ca828c96" have entirely different histories.

3 changed files with 5 additions and 4 deletions

View file

@ -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<{ post: number, check: Boolean }[]>([])
const [verifyli, setVerifyli] = useState<{ id: number, ck: Boolean }[]>([])
const load = () => {
setLoading(true)
fetch(rootstr + "/api/admin/fetch_post", { credentials: "include" }).then(async val => {

View file

@ -2,6 +2,7 @@ package handlers
import (
"bytes"
"context"
"encoding/base64"
"image/png"
"log"
@ -186,7 +187,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(), post_verify.Id)
log.Println(err.Error())
return c.SendStatus(fiber.StatusBadRequest)
}
@ -213,7 +214,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(), post_verify.Id)
log.Println(err.Error())
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 (
id serial PRIMARY KEY,
content varchar(500) not null,
content varchar(200) not null,
signing varchar(20),
hash char(64) UNIQUE NOT NULL,
post_at timestamp with time zone DEFAULT now(),