From 4af3640bd327f62ababdaa20105ddb82b4a969a7 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Mon, 22 Jan 2024 17:44:03 +0900
Subject: [PATCH] fix lint

---
 packages/backend/src/core/AntennaService.ts | 12 +++++++++---
 packages/backend/src/core/MetaService.ts    |  5 ++++-
 packages/backend/src/core/RoleService.ts    |  3 ++-
 packages/backend/src/core/WebhookService.ts |  9 ++++++---
 4 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts
index 2c27a0255..295915307 100644
--- a/packages/backend/src/core/AntennaService.ts
+++ b/packages/backend/src/core/AntennaService.ts
@@ -55,23 +55,29 @@ export class AntennaService implements OnApplicationShutdown {
 			const { type, body } = obj.message as GlobalEvents['internal']['payload'];
 			switch (type) {
 				case 'antennaCreated':
-					this.antennas.push({
+					this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
 						...body,
 						lastUsedAt: new Date(body.lastUsedAt),
+						user: null, // joinなカラムは通常取ってこないので
+						userList: null, // joinなカラムは通常取ってこないので
 					});
 					break;
 				case 'antennaUpdated': {
 					const idx = this.antennas.findIndex(a => a.id === body.id);
 					if (idx >= 0) {
-						this.antennas[idx] = {
+						this.antennas[idx] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
 							...body,
 							lastUsedAt: new Date(body.lastUsedAt),
+							user: null, // joinなカラムは通常取ってこないので
+							userList: null, // joinなカラムは通常取ってこないので
 						};
 					} else {
 						// サーバ起動時にactiveじゃなかった場合、リストに持っていないので追加する必要あり
-						this.antennas.push({
+						this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
 							...body,
 							lastUsedAt: new Date(body.lastUsedAt),
+							user: null, // joinなカラムは通常取ってこないので
+							userList: null, // joinなカラムは通常取ってこないので
 						});
 					}
 				}
diff --git a/packages/backend/src/core/MetaService.ts b/packages/backend/src/core/MetaService.ts
index 80e802096..8e945e3d8 100644
--- a/packages/backend/src/core/MetaService.ts
+++ b/packages/backend/src/core/MetaService.ts
@@ -51,7 +51,10 @@ export class MetaService implements OnApplicationShutdown {
 			const { type, body } = obj.message as GlobalEvents['internal']['payload'];
 			switch (type) {
 				case 'metaUpdated': {
-					this.cache = body;
+					this.cache = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
+						...body,
+						proxyAccount: null, // joinなカラムは通常取ってこないので
+					};
 					break;
 				}
 				default:
diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts
index d354faa7c..2c1a5280b 100644
--- a/packages/backend/src/core/RoleService.ts
+++ b/packages/backend/src/core/RoleService.ts
@@ -177,9 +177,10 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
 				case 'userRoleAssigned': {
 					const cached = this.roleAssignmentByUserIdCache.get(body.userId);
 					if (cached) {
-						cached.push({
+						cached.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
 							...body,
 							expiresAt: body.expiresAt ? new Date(body.expiresAt) : null,
+							user: null, // joinなカラムは通常取ってこないので
 						});
 					}
 					break;
diff --git a/packages/backend/src/core/WebhookService.ts b/packages/backend/src/core/WebhookService.ts
index 930e6ef64..5937bf89b 100644
--- a/packages/backend/src/core/WebhookService.ts
+++ b/packages/backend/src/core/WebhookService.ts
@@ -49,9 +49,10 @@ export class WebhookService implements OnApplicationShutdown {
 			switch (type) {
 				case 'webhookCreated':
 					if (body.active) {
-						this.webhooks.push({
+						this.webhooks.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
 							...body,
 							latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null,
+							user: null, // joinなカラムは通常取ってこないので
 						});
 					}
 					break;
@@ -59,14 +60,16 @@ export class WebhookService implements OnApplicationShutdown {
 					if (body.active) {
 						const i = this.webhooks.findIndex(a => a.id === body.id);
 						if (i > -1) {
-							this.webhooks[i] = {
+							this.webhooks[i] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
 								...body,
 								latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null,
+								user: null, // joinなカラムは通常取ってこないので
 							};
 						} else {
-							this.webhooks.push({
+							this.webhooks.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
 								...body,
 								latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null,
+								user: null, // joinなカラムは通常取ってこないので
 							});
 						}
 					} else {