This commit is contained in:
mattyatea 2024-05-06 07:41:47 +09:00
parent 024ce3c881
commit 9f60e186b0
5 changed files with 24 additions and 81 deletions

View file

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
@ -88,9 +88,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
super(meta, paramDef, async (ps, me) => {
const avatarDecorations = await this.avatarDecorationService.getAll(true);
const filteredAvatarDecorations = avatarDecorations.filter(avatarDecoration => avatarDecoration.host === null);
console.log(filteredAvatarDecorations);
return filteredAvatarDecorations.map(avatarDecoration => ({
return avatarDecorations.map(avatarDecoration => ({
id: avatarDecoration.id,
createdAt: this.idService.parse(avatarDecoration.id).date.toISOString(),
updatedAt: avatarDecoration.updatedAt?.toISOString() ?? null,

View file

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
@ -70,10 +70,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const decorations = await this.avatarDecorationService.getAll(true);
const allRoles = await this.roleService.getRoles();
// Filter decorations where host is null
const filteredDecorations = decorations.filter(decoration => decoration.host === null);
return filteredDecorations.map(decoration => ({
return decorations.map(decoration => ({
id: decoration.id,
name: decoration.name,
description: decoration.description,