修复bug
This commit is contained in:
parent
6996067b0e
commit
e30558eadb
@ -44,7 +44,7 @@ export default router.post(
|
|||||||
.db("o_storyboard")
|
.db("o_storyboard")
|
||||||
.whereIn("id", finalStoryboardIds)
|
.whereIn("id", finalStoryboardIds)
|
||||||
.where("scriptId", scriptId)
|
.where("scriptId", scriptId)
|
||||||
.whereNot("shouldGenerateImage", 0)
|
.whereNot("shouldGenerateImage", 1)
|
||||||
.update({ state: "生成中" });
|
.update({ state: "生成中" });
|
||||||
|
|
||||||
const projectSettingData = await u.db("o_project").where("id", projectId).select("imageModel", "imageQuality", "artStyle", "videoRatio").first();
|
const projectSettingData = await u.db("o_project").where("id", projectId).select("imageModel", "imageQuality", "artStyle", "videoRatio").first();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import u from "@/utils";
|
import u from "@/utils";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { success } from "@/lib/responseFormat";
|
import { error, success } from "@/lib/responseFormat";
|
||||||
import { validateFields } from "@/middleware/middleware";
|
import { validateFields } from "@/middleware/middleware";
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
@ -12,6 +12,10 @@ export default router.post(
|
|||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { id } = req.body;
|
const { id } = req.body;
|
||||||
|
const storyboardData = await u.db("o_storyboard").where("id", id).select("id", "track", "trackId").first();
|
||||||
|
if (!storyboardData) return res.status(400).send(error("未找到该分镜"));
|
||||||
|
const trackData = await u.db("o_storyboard").where("track", storyboardData.track).select("id");
|
||||||
|
if (trackData.length == 1) await u.db("o_videoTrack").where("id", storyboardData.trackId).delete();
|
||||||
await u.db("o_storyboard").where("id", id).delete();
|
await u.db("o_storyboard").where("id", id).delete();
|
||||||
await u.db("o_assets2Storyboard").where("storyboardId", id).delete();
|
await u.db("o_assets2Storyboard").where("storyboardId", id).delete();
|
||||||
res.status(200).send(success({ message: "视频删除成功" }));
|
res.status(200).send(success({ message: "视频删除成功" }));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user