update: controller

This commit is contained in:
2025-12-22 16:08:00 +03:30
parent ea7160c1de
commit f9891facce
+4 -4
View File
@@ -98,7 +98,7 @@ export class IconsService {
async removeIcon(id: string) {
try {
const { data } = await firstValueFrom(
const response = await firstValueFrom(
this.httpService.delete(`${this.config.baseUrl}/super-admin/icons/${id}`, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to delete icon: ${err.message}`, err.stack);
@@ -106,7 +106,7 @@ export class IconsService {
}),
),
);
return data;
return response.data ?? { message: "Icon deleted successfully" };
} catch (error: unknown) {
this.logger.error(`Error deleting icon: ${error instanceof Error ? error.message : "Unknown error"}`);
throw error;
@@ -184,7 +184,7 @@ export class IconsService {
async removeGroup(id: string) {
try {
const { data } = await firstValueFrom(
const response = await firstValueFrom(
this.httpService.delete(`${this.config.baseUrl}/super-admin/icons/groups/${id}`, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to delete group: ${err.message}`, err.stack);
@@ -192,7 +192,7 @@ export class IconsService {
}),
),
);
return data;
return response.data ?? { message: "Group deleted successfully" };
} catch (error: unknown) {
this.logger.error(`Error deleting group: ${error instanceof Error ? error.message : "Unknown error"}`);
throw error;