forked from Yara724/api
YARA-689
This commit is contained in:
@@ -109,7 +109,7 @@ export class SandHubService {
|
||||
|
||||
// Vehicle information
|
||||
MapTypNam: newResponse.vehiclePersianName || newResponse.MapTypNam,
|
||||
UsageField: newResponse.persianCarType || newResponse.UsageField || newResponse.usgCod,
|
||||
UsageField: newResponse.persianCarType || newResponse.UsageField || (newResponse.usgCod === "8" ? "شخصی" : "نامشخص"),
|
||||
MapUsageName: newResponse.MapUsageName || newResponse.MapUsageName,
|
||||
|
||||
// Financial coverage
|
||||
@@ -171,7 +171,13 @@ export class SandHubService {
|
||||
const response = await this.makeSandHubRequest(requestUrl, requestPayload);
|
||||
|
||||
// Map the new API response format to the old format
|
||||
return this.mapNewApiResponseToOldFormat(response);
|
||||
let result = this.mapNewApiResponseToOldFormat(response);
|
||||
|
||||
if (result.usgCod !== "8") {
|
||||
throw new Error("خودرو شما شخصی / سواری نمی باشد")
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user