Re-add new endpoint call
This commit is contained in:
parent
e6df0cbf93
commit
6d10f3e64f
1 changed files with 18 additions and 2 deletions
|
|
@ -1038,8 +1038,24 @@ export const useMainStore = defineStore({
|
||||||
return this.getProviders(zipCode, radius, true)
|
return this.getProviders(zipCode, radius, true)
|
||||||
},
|
},
|
||||||
|
|
||||||
getTpaProviders(zipCode, radius) {
|
getTpaAndSafeliteProviders(zipCode, provderNameSearchString = "") {
|
||||||
return this.getProviders(zipCode, radius, false)
|
const { parentAccountNumber } = this.order;
|
||||||
|
const carId = this.order.vehicle.carId;
|
||||||
|
const damageType = this.damage.isRepair ? 'Repair' : 'Install';
|
||||||
|
|
||||||
|
const parts = getLineItemsFlattened(this.order.lineItems.glassParts);
|
||||||
|
const partNumbers = parts.map((part) => part.partNumber).join(',');
|
||||||
|
|
||||||
|
let url = `${endpoints.GetTpaAndSafeliteProviders.url}/${zipCode}?accountNumber=${parentAccountNumber}&carId=${carId}&damageType=${damageType}&partNumbers=${partNumbers}`;
|
||||||
|
if (provderNameSearchString) {
|
||||||
|
url += `&providerNameSearchString=${provderNameSearchString}`;
|
||||||
|
}
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
globalMethods.callHttpClient({
|
||||||
|
method: endpoints.GetTpaAndSafeliteProviders.method,
|
||||||
|
endpoint: url
|
||||||
|
}).then((response) => resolve(response), (error) => reject(error));
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getProviders(zipcode, radius, safeliteOnly) {
|
getProviders(zipcode, radius, safeliteOnly) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue