fix(record): reject error

This commit is contained in:
oiov
2025-06-18 10:48:35 +08:00
parent 2f8baab19a
commit 858b02fa0c
7 changed files with 8 additions and 44 deletions

View File

@@ -3,8 +3,6 @@
import { revalidatePath } from "next/cache";
import { auth } from "@/auth";
// import { hash } from "crypt";
import { prisma } from "@/lib/db";
import { hashPassword } from "@/lib/utils";
import { userPasswordSchema } from "@/lib/validations/user";

View File

@@ -39,7 +39,7 @@ export async function POST(req: Request) {
record,
);
console.log("[data]", data);
// console.log("[data]", data);
if (!data.success || !data.result?.id) {
return Response.json(data.errors[0].message, {

View File

@@ -17,7 +17,7 @@ export async function POST(req: Request) {
});
}
const { record: reviewRecord, userId, recordId } = await req.json();
const { record: reviewRecord, userId, recordId, id } = await req.json();
const record = {
...reviewRecord,
recordId,
@@ -39,7 +39,7 @@ export async function POST(req: Request) {
// record,
// );
const res = await updateUserRecordReview(userId, recordId, {
const res = await updateUserRecordReview(userId, id, {
record_id: recordId,
zone_id: matchedZone.cf_zone_id,
zone_name: matchedZone.domain_name,

View File

@@ -199,9 +199,10 @@ export function RecordForm({
const response = await fetch(`${action}/reject`, {
method: "POST",
body: JSON.stringify({
recordId: initData?.record_id,
record: data,
id: initData?.id,
userId: initData?.userId,
record: data,
recordId: initData?.record_id,
}),
});
if (!response.ok || response.status !== 200) {
@@ -249,6 +250,7 @@ export function RecordForm({
method: "POST",
body: JSON.stringify({
record: data,
recordId: initData?.record_id,
userId: initData?.userId,
id: initData?.id,
}),

View File

@@ -75,7 +75,6 @@
"@vercel/analytics": "^1.3.1",
"@vercel/functions": "^1.4.0",
"@vercel/og": "^0.6.2",
"bcrypt": "^6.0.0",
"chalk": "^4.1.1",
"cheerio": "1.0.0-rc.12",
"class-variance-authority": "^0.7.0",
@@ -141,7 +140,6 @@
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@tailwindcss/line-clamp": "^0.4.4",
"@tailwindcss/typography": "^0.5.13",
"@types/bcrypt": "^5.0.2",
"@types/lodash": "^4.17.16",
"@types/node": "^20.14.11",
"@types/qrcode": "^1.5.5",

34
pnpm-lock.yaml generated
View File

@@ -158,9 +158,6 @@ importers:
'@vercel/og':
specifier: ^0.6.2
version: 0.6.2
bcrypt:
specifier: ^6.0.0
version: 6.0.0
chalk:
specifier: ^4.1.1
version: 4.1.2
@@ -351,9 +348,6 @@ importers:
'@tailwindcss/typography':
specifier: ^0.5.13
version: 0.5.13(tailwindcss@3.4.6)
'@types/bcrypt':
specifier: ^5.0.2
version: 5.0.2
'@types/lodash':
specifier: ^4.17.16
version: 4.17.16
@@ -3151,9 +3145,6 @@ packages:
'@types/acorn@4.0.6':
resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==}
'@types/bcrypt@5.0.2':
resolution: {integrity: sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==}
'@types/conventional-commits-parser@5.0.0':
resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==}
@@ -3817,10 +3808,6 @@ packages:
resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==}
engines: {node: ^4.5.0 || >= 5.9}
bcrypt@6.0.0:
resolution: {integrity: sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg==}
engines: {node: '>= 18'}
big.js@5.2.2:
resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==}
@@ -6184,14 +6171,6 @@ packages:
no-case@3.0.4:
resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==}
node-addon-api@8.4.0:
resolution: {integrity: sha512-D9DI/gXHvVmjHS08SVch0Em8G5S1P+QWtU31appcKT/8wFSPRcdHadIFSAntdMMVM5zz+/DL+bL/gz3UDppqtg==}
engines: {node: ^18 || ^20 || >= 21}
node-gyp-build@4.8.4:
resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==}
hasBin: true
node-releases@2.0.14:
resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==}
@@ -11126,10 +11105,6 @@ snapshots:
dependencies:
'@types/estree': 1.0.5
'@types/bcrypt@5.0.2':
dependencies:
'@types/node': 20.14.11
'@types/conventional-commits-parser@5.0.0':
dependencies:
'@types/node': 20.14.11
@@ -11951,11 +11926,6 @@ snapshots:
base64id@2.0.0: {}
bcrypt@6.0.0:
dependencies:
node-addon-api: 8.4.0
node-gyp-build: 4.8.4
big.js@5.2.2: {}
binary-extensions@2.2.0: {}
@@ -14915,10 +14885,6 @@ snapshots:
lower-case: 2.0.2
tslib: 2.8.1
node-addon-api@8.4.0: {}
node-gyp-build@4.8.4: {}
node-releases@2.0.14: {}
node-releases@2.0.18: {}

File diff suppressed because one or more lines are too long