fix : delete endpoints bug

This commit is contained in:
2025-12-30 22:46:21 +03:30
parent f46ecb393e
commit 3c0b583a9d
2 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -99,7 +99,7 @@ export class IconsService {
async removeIcon(id: string) { async removeIcon(id: string) {
try { try {
const response = await firstValueFrom( const response = await firstValueFrom(
this.httpService.delete(`${this.config.baseUrl}/super-admin/icons/${id}`, { headers: this.getHeaders() }).pipe( this.httpService.delete(`${this.config.baseUrl}/super-admin/icons/${id}`, { headers: this.getHeaders(), data: {} }).pipe(
catchError((err: AxiosError) => { catchError((err: AxiosError) => {
this.logger.error(`Failed to delete icon: ${err.message}`, err.stack); this.logger.error(`Failed to delete icon: ${err.message}`, err.stack);
return throwError(() => err); return throwError(() => err);
@@ -185,7 +185,7 @@ export class IconsService {
async removeGroup(id: string) { async removeGroup(id: string) {
try { try {
const response = await firstValueFrom( const response = await firstValueFrom(
this.httpService.delete(`${this.config.baseUrl}/super-admin/icons/groups/${id}`, { headers: this.getHeaders() }).pipe( this.httpService.delete(`${this.config.baseUrl}/super-admin/icons/groups/${id}`, { headers: this.getHeaders(), data: {} }).pipe(
catchError((err: AxiosError) => { catchError((err: AxiosError) => {
this.logger.error(`Failed to delete group: ${err.message}`, err.stack); this.logger.error(`Failed to delete group: ${err.message}`, err.stack);
return throwError(() => err); return throwError(() => err);
@@ -37,8 +37,8 @@ export class RestaurantService {
const params: Record<string, any> = { const params: Record<string, any> = {
page: queryDto.page || 1, page: queryDto.page || 1,
limit: queryDto.limit || 10, limit: queryDto.limit || 10,
orderBy: queryDto.orderBy || 'createdAt', orderBy: queryDto.orderBy || "createdAt",
order: queryDto.order || 'desc', order: queryDto.order || "desc",
}; };
if (queryDto.search) { if (queryDto.search) {
@@ -86,7 +86,7 @@ export class RestaurantService {
if (!userSubscription) { if (!userSubscription) {
throw new BadRequestException(SubscriptionMessage.USER_SUBS_NOT_FOUND); throw new BadRequestException(SubscriptionMessage.USER_SUBS_NOT_FOUND);
} }
const plan = userSubscription.plan.name.includes('دلیوری') ? PlanEnum.Premium : PlanEnum.Base; const plan = userSubscription.plan.name.includes("دلیوری") ? PlanEnum.Premium : PlanEnum.Base;
const setupRestaurantDto: ISetupRestaurant = { const setupRestaurantDto: ISetupRestaurant = {
name: dto.name, name: dto.name,
@@ -189,7 +189,7 @@ export class RestaurantService {
try { try {
const { data } = await firstValueFrom( const { data } = await firstValueFrom(
this.httpService this.httpService
.get(this.config.baseUrl + '/super-admin/notifications/sms-count', { .get(this.config.baseUrl + "/super-admin/notifications/sms-count", {
params: { page, limit }, params: { page, limit },
}) })
.pipe( .pipe(
@@ -279,6 +279,7 @@ export class RestaurantService {
this.httpService this.httpService
.delete(`${this.config.baseUrl}/super-admin/restaurants/${restaurantId}/admins/${adminId}`, { .delete(`${this.config.baseUrl}/super-admin/restaurants/${restaurantId}/admins/${adminId}`, {
headers: this.getHeaders(), headers: this.getHeaders(),
data: {},
}) })
.pipe( .pipe(
catchError((err: AxiosError) => { catchError((err: AxiosError) => {
@@ -331,4 +332,3 @@ export class RestaurantService {
} }
} }
} }