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