Fix bugs and clean noise reduction
This commit is contained in:
@@ -19,7 +19,8 @@ export async function handleSaveRoom(command: SaveRoomCommand, dataSource: DataS
|
||||
icon: room.icon ?? null,
|
||||
iconUpdatedAt: room.iconUpdatedAt ?? null,
|
||||
permissions: room.permissions != null ? JSON.stringify(room.permissions) : null,
|
||||
channels: room.channels != null ? JSON.stringify(room.channels) : null
|
||||
channels: room.channels != null ? JSON.stringify(room.channels) : null,
|
||||
members: room.members != null ? JSON.stringify(room.members) : null
|
||||
});
|
||||
|
||||
await repo.save(entity);
|
||||
|
||||
@@ -12,7 +12,8 @@ const ROOM_TRANSFORMS: TransformMap = {
|
||||
isPrivate: boolToInt,
|
||||
userCount: (val) => (val ?? 0),
|
||||
permissions: jsonOrNull,
|
||||
channels: jsonOrNull
|
||||
channels: jsonOrNull,
|
||||
members: jsonOrNull
|
||||
};
|
||||
|
||||
export async function handleUpdateRoom(command: UpdateRoomCommand, dataSource: DataSource): Promise<void> {
|
||||
|
||||
@@ -60,7 +60,8 @@ export function rowToRoom(row: RoomEntity) {
|
||||
icon: row.icon ?? undefined,
|
||||
iconUpdatedAt: row.iconUpdatedAt ?? undefined,
|
||||
permissions: row.permissions ? JSON.parse(row.permissions) : undefined,
|
||||
channels: row.channels ? JSON.parse(row.channels) : undefined
|
||||
channels: row.channels ? JSON.parse(row.channels) : undefined,
|
||||
members: row.members ? JSON.parse(row.members) : undefined
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ export interface RoomPayload {
|
||||
iconUpdatedAt?: number;
|
||||
permissions?: unknown;
|
||||
channels?: unknown[];
|
||||
members?: unknown[];
|
||||
}
|
||||
|
||||
export interface BanPayload {
|
||||
|
||||
Reference in New Issue
Block a user