diff --git a/src/scene/services/scene.service.ts b/src/scene/services/scene.service.ts index 3278970..8a2107e 100644 --- a/src/scene/services/scene.service.ts +++ b/src/scene/services/scene.service.ts @@ -426,10 +426,18 @@ export class SceneService { } async getAllIcons() { try { - const icons = await this.sceneIconRepository.find(); - return icons; + const icons = await this.sceneIconRepository.find({ + where: { iconType: SceneIconType.Other }, + }); + + // Remove duplicates based on 'icon' property + const uniqueIcons = icons.filter( + (icon, index, self) => + index === self.findIndex((t) => t.icon === icon.icon), + ); + + return uniqueIcons; } catch (err) { - // Improved error handling throw new HttpException( { statusCode: HttpStatus.INTERNAL_SERVER_ERROR,