Merge branch 'dev'

This commit is contained in:
faris Aljohari
2024-10-30 19:50:06 -05:00

View File

@ -426,10 +426,18 @@ export class SceneService {
} }
async getAllIcons() { async getAllIcons() {
try { try {
const icons = await this.sceneIconRepository.find(); const icons = await this.sceneIconRepository.find({
return icons; 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) { } catch (err) {
// Improved error handling
throw new HttpException( throw new HttpException(
{ {
statusCode: HttpStatus.INTERNAL_SERVER_ERROR, statusCode: HttpStatus.INTERNAL_SERVER_ERROR,