2021-08-19 21:55:45 +09:00
|
|
|
import define from '../../define';
|
|
|
|
|
import { MutedNotes } from '@/models/index';
|
2020-08-09 13:46:19 +09:00
|
|
|
|
|
|
|
|
export const meta = {
|
|
|
|
|
tags: ['account'],
|
|
|
|
|
|
|
|
|
|
requireCredential: true as const,
|
|
|
|
|
|
|
|
|
|
kind: 'read:account',
|
|
|
|
|
|
|
|
|
|
params: {
|
2021-03-06 22:34:11 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
res: {
|
|
|
|
|
type: 'object' as const,
|
|
|
|
|
optional: false as const, nullable: false as const,
|
|
|
|
|
properties: {
|
|
|
|
|
count: {
|
|
|
|
|
type: 'number' as const,
|
2021-12-09 23:58:30 +09:00
|
|
|
optional: false as const, nullable: false as const,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2020-08-09 13:46:19 +09:00
|
|
|
};
|
|
|
|
|
|
2022-01-03 02:12:50 +09:00
|
|
|
// eslint-disable-next-line import/no-default-export
|
2020-08-09 13:46:19 +09:00
|
|
|
export default define(meta, async (ps, user) => {
|
|
|
|
|
return {
|
|
|
|
|
count: await MutedNotes.count({
|
|
|
|
|
userId: user.id,
|
2021-12-09 23:58:30 +09:00
|
|
|
reason: 'word',
|
|
|
|
|
}),
|
2020-08-09 13:46:19 +09:00
|
|
|
};
|
|
|
|
|
});
|