update icons service endpoints

This commit is contained in:
morteza-mortezai
2025-12-16 13:05:24 +03:30
parent c6797809f8
commit 36f09b816a
+10 -10
View File
@@ -31,7 +31,7 @@ export class IconsService {
async createIcon(dto: CreateIconDto) {
try {
const { data } = await firstValueFrom(
this.httpService.post(`${this.config.baseUrl}/admin/icons`, dto, { headers: this.getHeaders() }).pipe(
this.httpService.post(`${this.config.baseUrl}/super-admin/icons`, dto, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to create icon: ${err.message}`, err.stack);
return throwError(() => err);
@@ -48,7 +48,7 @@ export class IconsService {
async findAllIcons() {
try {
const { data } = await firstValueFrom(
this.httpService.get(`${this.config.baseUrl}/admin/icons`, { headers: this.getHeaders() }).pipe(
this.httpService.get(`${this.config.baseUrl}/super-admin/icons`, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to fetch icons: ${err.message}`, err.stack);
return throwError(() => err);
@@ -65,7 +65,7 @@ export class IconsService {
async findOneIcon(id: string) {
try {
const { data } = await firstValueFrom(
this.httpService.get(`${this.config.baseUrl}/admin/icons/${id}`, { headers: this.getHeaders() }).pipe(
this.httpService.get(`${this.config.baseUrl}/super-admin/icons/${id}`, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to fetch icon: ${err.message}`, err.stack);
return throwError(() => err);
@@ -82,7 +82,7 @@ export class IconsService {
async updateIcon(id: string, dto: UpdateIconDto) {
try {
const { data } = await firstValueFrom(
this.httpService.patch(`${this.config.baseUrl}/admin/icons/${id}`, dto, { headers: this.getHeaders() }).pipe(
this.httpService.patch(`${this.config.baseUrl}/super-admin/icons/${id}`, dto, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to update icon: ${err.message}`, err.stack);
return throwError(() => err);
@@ -99,7 +99,7 @@ export class IconsService {
async removeIcon(id: string) {
try {
const { data } = await firstValueFrom(
this.httpService.delete(`${this.config.baseUrl}/admin/icons/${id}`, { headers: this.getHeaders() }).pipe(
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);
return throwError(() => err);
@@ -117,7 +117,7 @@ export class IconsService {
async createGroup(dto: CreateGroupDto) {
try {
const { data } = await firstValueFrom(
this.httpService.post(`${this.config.baseUrl}/admin/icons/groups`, dto, { headers: this.getHeaders() }).pipe(
this.httpService.post(`${this.config.baseUrl}/super-admin/icons/groups`, dto, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to create group: ${err.message}`, err.stack);
return throwError(() => err);
@@ -134,7 +134,7 @@ export class IconsService {
async findAllGroups() {
try {
const { data } = await firstValueFrom(
this.httpService.get(`${this.config.baseUrl}/admin/icons/groups`, { headers: this.getHeaders() }).pipe(
this.httpService.get(`${this.config.baseUrl}/super-admin/icons/groups`, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to fetch groups: ${err.message}`, err.stack);
return throwError(() => err);
@@ -151,7 +151,7 @@ export class IconsService {
async findOneGroup(id: string) {
try {
const { data } = await firstValueFrom(
this.httpService.get(`${this.config.baseUrl}/admin/icons/groups/${id}`, { headers: this.getHeaders() }).pipe(
this.httpService.get(`${this.config.baseUrl}/super-admin/icons/groups/${id}`, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to fetch group: ${err.message}`, err.stack);
return throwError(() => err);
@@ -168,7 +168,7 @@ export class IconsService {
async updateGroup(id: string, dto: UpdateGroupDto) {
try {
const { data } = await firstValueFrom(
this.httpService.patch(`${this.config.baseUrl}/admin/icons/groups/${id}`, dto, { headers: this.getHeaders() }).pipe(
this.httpService.patch(`${this.config.baseUrl}/super-admin/icons/groups/${id}`, dto, { headers: this.getHeaders() }).pipe(
catchError((err: AxiosError) => {
this.logger.error(`Failed to update group: ${err.message}`, err.stack);
return throwError(() => err);
@@ -185,7 +185,7 @@ export class IconsService {
async removeGroup(id: string) {
try {
const { data } = await firstValueFrom(
this.httpService.delete(`${this.config.baseUrl}/admin/icons/groups/${id}`, { headers: this.getHeaders() }).pipe(
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);
return throwError(() => err);