update : routes

This commit is contained in:
2025-12-27 16:28:51 +03:30
parent 0e1aedc95d
commit 3c7ccf8455
2 changed files with 45 additions and 7 deletions
@@ -85,16 +85,14 @@ export class RestaurantService {
phone: dto.phone,
plan,
subscriptionId: dto.userSubscriptionId,
subscriptionEndDate: userSubscription.endDate,
subscriptionStartDate: userSubscription.startDate,
subscriptionEndDate: userSubscription.endDate.toISOString(),
subscriptionStartDate: userSubscription.startDate.toISOString(),
};
try {
const { data } = await firstValueFrom(
this.httpService
.post(`${this.config.baseUrl}/super-admin/restaurants`, {
setupRestaurantDto
}, {
.post(`${this.config.baseUrl}/super-admin/restaurants`, setupRestaurantDto, {
headers: this.getHeaders(),
})
.pipe(
@@ -125,5 +123,27 @@ export class RestaurantService {
// Add actual data structure based on your requirements
};
}
async getSmsCountByRestaurant(page: number, limit: number) {
try {
const { data } = await firstValueFrom(
this.httpService
.get('super-admin/notifications/sms-count', {
params: { page, limit },
})
.pipe(
catchError((err: AxiosError) => {
this.logger.error("error in getting SMS count by restaurant", err);
throw new BadRequestException("Failed to fetch SMS count data");
}),
),
);
return data;
} catch (error) {
this.logger.error("error in getSmsCountByRestaurant", error);
throw error;
}
}
}