Merge branch '108' of https://github.com/HBAI-Ltd/Toonflow-app into 108
This commit is contained in:
commit
f06e7d7f9c
@ -14,7 +14,7 @@ export default router.post(
|
|||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { assetsId } = req.body;
|
const { assetsId } = req.body;
|
||||||
|
|
||||||
const assets = await u.db("o_assets").where("id", assetsId).select("id", "imageId", "type", "state").first();
|
const assets = await u.db("o_assets").where("id", assetsId).select("id", "imageId", "type").first();
|
||||||
|
|
||||||
const rawTempAssets = await u.db("o_image").where("assetsId", assetsId).select("id", "filePath", "assetsId", "type", "state");
|
const rawTempAssets = await u.db("o_image").where("assetsId", assetsId).select("id", "filePath", "assetsId", "type", "state");
|
||||||
|
|
||||||
@ -28,10 +28,10 @@ export default router.post(
|
|||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
id: assets!.id,
|
id: assets!.id,
|
||||||
state: assets!.state,
|
|
||||||
imageId: assets!.imageId ?? null,
|
imageId: assets!.imageId ?? null,
|
||||||
tempAssets,
|
tempAssets,
|
||||||
};
|
};
|
||||||
|
console.log("%c Line:30 🥤 data", "background:#465975", data);
|
||||||
res.status(200).send(success(data));
|
res.status(200).send(success(data));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@ -14,8 +14,13 @@ export default router.post(
|
|||||||
data: flowDataSchema,
|
data: flowDataSchema,
|
||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { projectId, episodesId } = req.body;
|
const { data, projectId, episodesId } = req.body;
|
||||||
const sqlData = await u.db("o_agentWorkData").where("projectId", String(projectId)).andWhere("episodesId", String(episodesId)).first();
|
const sqlData = await u.db("o_agentWorkData").where("projectId", String(projectId)).andWhere("episodesId", String(episodesId)).first();
|
||||||
|
for (let item of data.storyboard) {
|
||||||
|
await u.db("o_storyboard").where("id", item.id).update({
|
||||||
|
index: item.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
if (!sqlData) {
|
if (!sqlData) {
|
||||||
await u.db("o_agentWorkData").insert({
|
await u.db("o_agentWorkData").insert({
|
||||||
projectId,
|
projectId,
|
||||||
|
|||||||
@ -9,11 +9,11 @@ const router = express.Router();
|
|||||||
export default router.post(
|
export default router.post(
|
||||||
"/",
|
"/",
|
||||||
validateFields({
|
validateFields({
|
||||||
id: z.number(),
|
id: z.array(z.number()),
|
||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { id } = req.body;
|
const { id } = req.body;
|
||||||
await u.db("o_script").where({ id }).delete();
|
await u.db("o_script").whereIn("id", id).delete();
|
||||||
res.status(200).send(success({ message: "删除剧本成功" }));
|
res.status(200).send(success({ message: "删除剧本成功" }));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user