update: change the danak services fetch to another route and accept category id "

query for that
This commit is contained in:
mahyargdz
2025-03-02 15:19:55 +03:30
parent af9f365bc7
commit 4d0344c376
9 changed files with 99 additions and 25 deletions
+5 -8
View File
@@ -3,6 +3,7 @@ import { Inject, Injectable, InternalServerErrorException, Logger } from "@nestj
import { AxiosError } from "axios";
import { catchError, firstValueFrom } from "rxjs";
import { SmsMessage } from "../../../common/enums/message.enum";
import { ISmsConfigs } from "../../../configs/sms.config";
import { SMS_CONFIG } from "../constants";
import { ISmsGetLineResponse, ISmsVerifyBody, ISmsVerifyResponse } from "../interfaces/ISms";
@@ -46,6 +47,7 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
throw new InternalServerErrorException(SmsMessage.SEND_SMS_ERROR);
}
}
//************************************************* */
@@ -81,7 +83,7 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
throw new InternalServerErrorException("error in sending sms");
throw new InternalServerErrorException(SmsMessage.SEND_SMS_ERROR);
}
}
//************************************************* */
@@ -109,7 +111,6 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
// throw new InternalServerErrorException("error in sending sms");
}
}
//************************************************* */
@@ -135,6 +136,8 @@ export class SmsService {
})
.pipe(
catchError((err: AxiosError) => {
console.error(err);
this.logger.error("error in sending invoice created sms", err);
throw new InternalServerErrorException("error in sending invoice created sms");
}),
@@ -143,7 +146,6 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
throw new InternalServerErrorException("error in sending sms");
}
}
//************************************************* */
@@ -174,7 +176,6 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
throw new InternalServerErrorException("error in sending sms");
}
}
//************************************************* */
@@ -206,7 +207,6 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
throw new InternalServerErrorException("error in sending sms");
}
}
//************************************************* */
@@ -239,7 +239,6 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
throw new InternalServerErrorException("error in sending sms");
}
}
@@ -272,7 +271,6 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
throw new InternalServerErrorException("error in sending sms");
}
}
//************************************************* */
@@ -303,7 +301,6 @@ export class SmsService {
return data;
} catch (error) {
this.logger.error("error in sending sms", error);
throw new InternalServerErrorException("error in sending sms");
}
}