init
This commit is contained in:
parent
8bd8c7532b
commit
9b7865e189
4 changed files with 5 additions and 4 deletions
|
@ -324,7 +324,7 @@ export function createImportPostsJob(
|
||||||
{
|
{
|
||||||
user: user,
|
user: user,
|
||||||
fileId: fileId,
|
fileId: fileId,
|
||||||
signatureCheck: signatureCheck,
|
type: type,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
removeOnComplete: true,
|
removeOnComplete: true,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type Bull from "bull";
|
||||||
import {
|
import {
|
||||||
createImportCkPostJob,
|
createImportCkPostJob,
|
||||||
createImportMastoPostJob,
|
createImportMastoPostJob,
|
||||||
|
// createImportTwtPostJob,
|
||||||
} from "@/queue/index.js";
|
} from "@/queue/index.js";
|
||||||
|
|
||||||
const logger = queueLogger.createSubLogger("import-posts");
|
const logger = queueLogger.createSubLogger("import-posts");
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const paramDef = {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
fileId: { type: "string", format: "misskey:id" },
|
fileId: { type: "string", format: "misskey:id" },
|
||||||
signatureCheck: { type: "boolean" },
|
type: { type: "string" },
|
||||||
},
|
},
|
||||||
required: ["fileId"],
|
required: ["fileId"],
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -51,5 +51,5 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
|
|
||||||
if (file == null) throw new ApiError(meta.errors.noSuchFile);
|
if (file == null) throw new ApiError(meta.errors.noSuchFile);
|
||||||
if (file.size === 0) throw new ApiError(meta.errors.emptyFile);
|
if (file.size === 0) throw new ApiError(meta.errors.emptyFile);
|
||||||
createImportPostsJob(user, file.id, ps.signatureCheck);
|
createImportPostsJob(user, file.id, ps.type);
|
||||||
});
|
});
|
||||||
|
|
|
@ -222,7 +222,7 @@ const importPosts = async (ev) => {
|
||||||
const file = await selectFile(ev.currentTarget ?? ev.target);
|
const file = await selectFile(ev.currentTarget ?? ev.target);
|
||||||
os.api("i/import-posts", {
|
os.api("i/import-posts", {
|
||||||
fileId: file.id,
|
fileId: file.id,
|
||||||
signatureCheck: importType.value === "mastodon" ? true : false,
|
type: importType.value,
|
||||||
})
|
})
|
||||||
.then(onImportSuccess)
|
.then(onImportSuccess)
|
||||||
.catch(onError);
|
.catch(onError);
|
||||||
|
|
Loading…
Reference in a new issue