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,
|
||||
fileId: fileId,
|
||||
signatureCheck: signatureCheck,
|
||||
type: type,
|
||||
},
|
||||
{
|
||||
removeOnComplete: true,
|
||||
|
|
|
@ -6,6 +6,7 @@ import type Bull from "bull";
|
|||
import {
|
||||
createImportCkPostJob,
|
||||
createImportMastoPostJob,
|
||||
// createImportTwtPostJob,
|
||||
} from "@/queue/index.js";
|
||||
|
||||
const logger = queueLogger.createSubLogger("import-posts");
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue