remove all mode

This commit is contained in:
tamaina 2021-07-27 03:10:24 +09:00
parent b96edad800
commit 0fdffe5288
1 changed files with 1 additions and 11 deletions

View File

@ -16,21 +16,11 @@ export const meta = {
endpoint: {
validator: $.str
},
all: {
validator: $.optional.bool,
default: false,
desc: {
'ja-JP': 'falseデフォルトは、自分の登録のみが解除されます。trueを指定すると、指定したエンドポイントのすべての登録を解除します。'
}
}
}
};
export default define(meta, async (ps, user) => {
await SwSubscriptions.delete(ps.all ? {
endpoint: ps.endpoint,
} : {
await SwSubscriptions.delete({
userId: user.id,
endpoint: ps.endpoint,
});