mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-20 01:28:09 +09:00
26 lines
518 B
TypeScript
26 lines
518 B
TypeScript
import { i18n } from "@/i18n";
|
|
import * as os from "@/os";
|
|
|
|
export async function indexPosts() {
|
|
const { canceled, result: index } = await os.inputText({
|
|
title: i18n.ts.indexFrom,
|
|
});
|
|
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,
|
|
});
|
|
}
|
|
}
|