From 9b7865e18992009cf6e3ddf302c06d252b55ba05 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 6 Jun 2023 15:38:32 -0700 Subject: [PATCH] init --- packages/backend/src/queue/index.ts | 2 +- packages/backend/src/queue/processors/db/import-posts.ts | 1 + packages/backend/src/server/api/endpoints/i/import-posts.ts | 4 ++-- packages/client/src/pages/settings/import-export.vue | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/queue/index.ts b/packages/backend/src/queue/index.ts index a84a446fe7..c5d5182c92 100644 --- a/packages/backend/src/queue/index.ts +++ b/packages/backend/src/queue/index.ts @@ -324,7 +324,7 @@ export function createImportPostsJob( { user: user, fileId: fileId, - signatureCheck: signatureCheck, + type: type, }, { removeOnComplete: true, diff --git a/packages/backend/src/queue/processors/db/import-posts.ts b/packages/backend/src/queue/processors/db/import-posts.ts index f92a5f710a..51515a3894 100644 --- a/packages/backend/src/queue/processors/db/import-posts.ts +++ b/packages/backend/src/queue/processors/db/import-posts.ts @@ -6,6 +6,7 @@ import type Bull from "bull"; import { createImportCkPostJob, createImportMastoPostJob, + // createImportTwtPostJob, } from "@/queue/index.js"; const logger = queueLogger.createSubLogger("import-posts"); diff --git a/packages/backend/src/server/api/endpoints/i/import-posts.ts b/packages/backend/src/server/api/endpoints/i/import-posts.ts index 3adba0514e..29995a9c0c 100644 --- a/packages/backend/src/server/api/endpoints/i/import-posts.ts +++ b/packages/backend/src/server/api/endpoints/i/import-posts.ts @@ -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); }); diff --git a/packages/client/src/pages/settings/import-export.vue b/packages/client/src/pages/settings/import-export.vue index b2ac12cad0..8cf2079e63 100644 --- a/packages/client/src/pages/settings/import-export.vue +++ b/packages/client/src/pages/settings/import-export.vue @@ -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);