You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

20 lines
636 B

import { defineWrappedResponseHandler } from "#server/utils/handler";
import { R } from "#server/utils/response";
import { listCharacterCards } from "#server/service/character/character-card";
import { parseTags } from "#server/service/character/persona";
export default defineWrappedResponseHandler(async () => {
const list = await listCharacterCards(true);
return R.success({
list: list
.filter((c) => c.isPublic === 1)
.map((c) => ({
id: c.id,
slug: c.slug,
name: c.name,
avatar: c.avatar,
description: c.description,
tags: parseTags(c.tags),
})),
});
});