parent
037837b551
commit
0e4a111f81
1714 changed files with 20803 additions and 11751 deletions
|
@ -0,0 +1,37 @@
|
|||
import $ from 'cafy';
|
||||
import define from '../../define';
|
||||
import { createNotification } from '@/services/create-notification';
|
||||
|
||||
export const meta = {
|
||||
tags: ['notifications'],
|
||||
|
||||
requireCredential: true as const,
|
||||
|
||||
kind: 'write:notifications',
|
||||
|
||||
params: {
|
||||
body: {
|
||||
validator: $.str
|
||||
},
|
||||
|
||||
header: {
|
||||
validator: $.optional.nullable.str
|
||||
},
|
||||
|
||||
icon: {
|
||||
validator: $.optional.nullable.str
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
}
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user, token) => {
|
||||
createNotification(user.id, 'app', {
|
||||
appAccessTokenId: token ? token.id : null,
|
||||
customBody: ps.body,
|
||||
customHeader: ps.header,
|
||||
customIcon: ps.icon,
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue