From 6c975275f82c79eed2c7757d55283c95d23ca5b8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 11 Jan 2021 20:38:34 +0900 Subject: Registry (#7073) * wip * wip * wip * wip * wip * Update registry.value.vue * wip * wip * wip * wip * typo --- .../api/endpoints/i/update-client-setting.ts | 40 ---------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/server/api/endpoints/i/update-client-setting.ts (limited to 'src/server/api/endpoints/i/update-client-setting.ts') diff --git a/src/server/api/endpoints/i/update-client-setting.ts b/src/server/api/endpoints/i/update-client-setting.ts deleted file mode 100644 index 5143d3d9ba..0000000000 --- a/src/server/api/endpoints/i/update-client-setting.ts +++ /dev/null @@ -1,40 +0,0 @@ -import $ from 'cafy'; -import { publishMainStream } from '../../../../services/stream'; -import define from '../../define'; -import { UserProfiles } from '../../../../models'; -import { ensure } from '../../../../prelude/ensure'; - -export const meta = { - requireCredential: true as const, - - secure: true, - - params: { - name: { - validator: $.str.match(/^[a-zA-Z]+$/) - }, - - value: { - validator: $.nullable.any - } - } -}; - -export default define(meta, async (ps, user) => { - const profile = await UserProfiles.findOne(user.id).then(ensure); - - await UserProfiles.createQueryBuilder().update() - .set({ - clientData: Object.assign(profile.clientData, { - [ps.name]: ps.value - }), - }) - .where('userId = :id', { id: user.id }) - .execute(); - - // Publish event - publishMainStream(user.id, 'clientSettingUpdated', { - key: ps.name, - value: ps.value - }); -}); -- cgit v1.2.3-freya