Compare commits
No commits in common. "be6413aed825eed29224c992033bd8250809e2e6" and "f19f26b9f6fdf04e337362c94ffb32e3ca828c96" have entirely different histories.
be6413aed8
...
f19f26b9f6
3 changed files with 5 additions and 4 deletions
|
@ -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<{ post: number, check: Boolean }[]>([])
|
const [verifyli, setVerifyli] = useState<{ id: number, ck: 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 => {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"image/png"
|
"image/png"
|
||||||
"log"
|
"log"
|
||||||
|
@ -186,7 +187,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(), post_verify.Id)
|
log.Println(err.Error())
|
||||||
return c.SendStatus(fiber.StatusBadRequest)
|
return c.SendStatus(fiber.StatusBadRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +214,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(), post_verify.Id)
|
log.Println(err.Error())
|
||||||
return c.SendStatus(fiber.StatusBadRequest)
|
return c.SendStatus(fiber.StatusBadRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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(500) not null,
|
content varchar(200) 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(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue