feat: 下载page到本地

This commit is contained in:
2024-10-08 17:10:32 +08:00
parent 54e3ccb3ff
commit 8cdd54af04
9 changed files with 361 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
import { ContainerModel } from '@/routes/container/models/index.ts';
import { ChatPrompt } from '@/models/chat-prompt.ts';
const recoverData = async () => {
const data = {
id: '868970a4-8cab-4141-a73c-cc185fd17508',
@@ -24,4 +24,24 @@ const recoverData = async () => {
const r = await ContainerModel.create(data);
};
recoverData();
// recoverData();
const revoverId = async () => {
const id = 'e235576e-eb48-4b5c-8385-9b8ada4a137f';
// const cp = await ChatPrompt.findByPk(id);
const cp = await ChatPrompt.findAll({
paranoid: false,
});
console.log(
cp.map((item) => {
return {
id: item.id,
// @ts-ignore
deletedAt: item.deletedAt,
};
}),
);
// cp 被删除了,复原
await ChatPrompt.restore({ where: { id } });
};
revoverId();