update: controller
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user