This commit is contained in:
ThatOneCalculator 2023-06-06 15:38:32 -07:00
parent 8bd8c7532b
commit 9b7865e189
No known key found for this signature in database
GPG key ID: 8703CACD01000000
4 changed files with 5 additions and 4 deletions

View file

@ -324,7 +324,7 @@ export function createImportPostsJob(
{
user: user,
fileId: fileId,
signatureCheck: signatureCheck,
type: type,
},
{
removeOnComplete: true,

View file

@ -6,6 +6,7 @@ import type Bull from "bull";
import {
createImportCkPostJob,
createImportMastoPostJob,
// createImportTwtPostJob,
} from "@/queue/index.js";
const logger = queueLogger.createSubLogger("import-posts");

View file

@ -37,7 +37,7 @@ export const paramDef = {
type: "object",
properties: {
fileId: { type: "string", format: "misskey:id" },
signatureCheck: { type: "boolean" },
type: { type: "string" },
},
required: ["fileId"],
} 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.size === 0) throw new ApiError(meta.errors.emptyFile);
createImportPostsJob(user, file.id, ps.signatureCheck);
createImportPostsJob(user, file.id, ps.type);
});

View file

@ -222,7 +222,7 @@ const importPosts = async (ev) => {
const file = await selectFile(ev.currentTarget ?? ev.target);
os.api("i/import-posts", {
fileId: file.id,
signatureCheck: importType.value === "mastodon" ? true : false,
type: importType.value,
})
.then(onImportSuccess)
.catch(onError);