Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { createNotification } from "../../../../services/create-notification.js";
|
||||
import define from "../../define.js";
|
||||
export const meta = {
|
||||
tags: [
|
||||
"notifications"
|
||||
],
|
||||
requireCredential: true,
|
||||
kind: "write:notifications",
|
||||
errors: {}
|
||||
};
|
||||
export const paramDef = {
|
||||
type: "object",
|
||||
properties: {
|
||||
body: {
|
||||
type: "string"
|
||||
},
|
||||
header: {
|
||||
type: "string",
|
||||
nullable: true
|
||||
},
|
||||
icon: {
|
||||
type: "string",
|
||||
nullable: true
|
||||
}
|
||||
},
|
||||
required: [
|
||||
"body"
|
||||
]
|
||||
};
|
||||
export default define(meta, paramDef, async (ps, user, token)=>{
|
||||
createNotification(user.id, "app", {
|
||||
appAccessTokenId: token ? token.id : null,
|
||||
customBody: ps.body,
|
||||
customHeader: ps.header,
|
||||
customIcon: ps.icon
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user