summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/sw/unregister.ts
blob: 817ad1f5176693319528d6c801073e4aab760bf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import $ from 'cafy';
import define from '../../define';
import { SwSubscriptions } from '../../../../models';

export const meta = {
	tags: ['account'],

	requireCredential: true as const,

	params: {
		endpoint: {
			validator: $.str
		},
	}
};

export default define(meta, async (ps, user) => {
	await SwSubscriptions.delete({
		userId: user.id,
		endpoint: ps.endpoint,
	});
});