iceshrimp-legacy/packages/client/src/scripts/index-posts.ts

27 lines
556 B
TypeScript
Raw Normal View History

2023-04-11 19:07:03 +02:00
import { i18n } from "@/i18n";
import * as os from "@/os";
export async function indexPosts() {
const { canceled, result: index } = await os.inputText({
title: i18n.ts.indexFrom,
2023-05-29 21:16:35 +02:00
text: i18n.ts.indexFromDescription,
2023-04-11 19:07:03 +02:00
});
if (canceled) return;
if (index == null || index === "") {
await os.api("admin/search/index-all");
await os.alert({
type: "info",
text: i18n.ts.indexNotice,
});
} else {
await os.api("admin/search/index-all", {
cursor: index,
});
await os.alert({
type: "info",
text: i18n.ts.indexNotice,
});
}
}