mirror of
https://github.com/misskey-dev/misskey
synced 2024-06-02 08:40:00 +02:00
4f180ad45c
* アイコンデコレーションの管理をロールで設定できるように * インポートミス * Update packages/frontend/src/ui/_common_/common.ts Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> * Update packages/frontend/src/ui/_common_/common.ts Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
39 lines
998 B
TypeScript
39 lines
998 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { Inject, Injectable } from '@nestjs/common';
|
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
|
import { DI } from '@/di-symbols.js';
|
|
import { AvatarDecorationService } from '@/core/AvatarDecorationService.js';
|
|
import { ApiError } from '../../../error.js';
|
|
|
|
export const meta = {
|
|
tags: ['admin'],
|
|
|
|
requireCredential: true,
|
|
requireRolePolicy: 'canManageAvatarDecorations',
|
|
errors: {
|
|
},
|
|
} as const;
|
|
|
|
export const paramDef = {
|
|
type: 'object',
|
|
properties: {
|
|
id: { type: 'string', format: 'misskey:id' },
|
|
},
|
|
required: ['id'],
|
|
} as const;
|
|
|
|
@Injectable()
|
|
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
|
constructor(
|
|
private avatarDecorationService: AvatarDecorationService,
|
|
) {
|
|
super(meta, paramDef, async (ps, me) => {
|
|
await this.avatarDecorationService.delete(ps.id, me);
|
|
});
|
|
}
|
|
}
|