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