From 0e4a111f81cceed275d9bec2695f6e401fb654d8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 12 Nov 2021 02:02:25 +0900 Subject: refactoring Resolve #7779 --- src/server/api/endpoints/room/update.ts | 51 --------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/server/api/endpoints/room/update.ts (limited to 'src/server/api/endpoints/room/update.ts') diff --git a/src/server/api/endpoints/room/update.ts b/src/server/api/endpoints/room/update.ts deleted file mode 100644 index 8c4cfbdea6..0000000000 --- a/src/server/api/endpoints/room/update.ts +++ /dev/null @@ -1,51 +0,0 @@ -import $ from 'cafy'; -import { publishMainStream } from '@/services/stream'; -import define from '../../define'; -import { Users, UserProfiles } from '@/models/index'; - -export const meta = { - tags: ['room'], - - requireCredential: true as const, - - params: { - room: { - validator: $.obj({ - furnitures: $.arr($.obj({ - id: $.str, - type: $.str, - position: $.obj({ - x: $.num, - y: $.num, - z: $.num, - }), - rotation: $.obj({ - x: $.num, - y: $.num, - z: $.num, - }), - props: $.optional.nullable.obj(), - })), - roomType: $.str, - carpetColor: $.str - }) - }, - }, -}; - -export default define(meta, async (ps, user) => { - await UserProfiles.update(user.id, { - room: ps.room as any - }); - - const iObj = await Users.pack(user.id, user, { - detail: true, - includeSecrets: true - }); - - // Publish meUpdated event - publishMainStream(user.id, 'meUpdated', iObj); - - // TODO: レスポンスがおかしいと思う by YuzuRyo61 - return iObj; -}); -- cgit v1.2.3-freya