Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { SwSubscriptions } from "../../../../models/index.js";
|
||||
import define from "../../define.js";
|
||||
export const meta = {
|
||||
tags: [
|
||||
"account"
|
||||
],
|
||||
requireCredential: false,
|
||||
description: "Unregister from receiving push notifications."
|
||||
};
|
||||
export const paramDef = {
|
||||
type: "object",
|
||||
properties: {
|
||||
endpoint: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
required: [
|
||||
"endpoint"
|
||||
]
|
||||
};
|
||||
export default define(meta, paramDef, async (ps, me)=>{
|
||||
await SwSubscriptions.delete({
|
||||
...me ? {
|
||||
userId: me.id
|
||||
} : {},
|
||||
endpoint: ps.endpoint
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user