mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 18:34:54 +00:00
Merge branch 'dev'
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user