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