Added experimental edit page and revision history.

This commit is contained in:
2024-09-10 02:47:03 +02:00
parent 4b8dfba289
commit 8bf9e22b39
20 changed files with 1177 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
import redis from './redis.js';
export async function getIdsBySlug(slugs, domain) {
export async function getIdsBySlug(slugs, domain, toMap) {
if (!slugs) {
return [];
}
@@ -21,5 +21,9 @@ export async function getIdsBySlug(slugs, domain) {
return Number(id);
}));
if (toMap) {
return Object.fromEntries(slugs.map((slug, index) => [slug, ids[index]]));
}
return ids.filter(Boolean);
}