PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
← All changes | resources/js/services/TaxService.ts +7 -3 3.0.8 → 3.0.16 View file →
@@ -7,8 +7,10 @@
7 7 * @since 3.0.0
8 8 */
9 9
10 10 import { formatYatraMoney } from "../lib/currency-display";
11 +import { apiClient } from "../lib/api-client";
12 +import { API_ENDPOINTS } from "../lib/api-endpoints";
11 13
12 14 interface TaxDetails {
13 15 tax_amount: number;
14 16 tax_rate: number;
@@ -55,11 +57,13 @@
55 57 * Load tax settings from API
56 58 */
57 59 async loadTaxSettings(): Promise<void> {
58 60 try {
59 - const response = await fetch("/wp-json/yatra/v1/settings");
60 - const settings = await response.json();
61 - this.taxSettings = settings;
61 + // Through the shared client so the REST nonce is sent — a bare fetch()
62 + // was answered with 401 on every admin booking form, so tax settings
63 + // never actually loaded here.
64 + const settings = await apiClient.get(API_ENDPOINTS.SETTINGS);
65 + this.taxSettings = (settings as any)?.data ?? settings;
62 66 } catch (error) {
63 67 console.error("Failed to load tax settings:", error);
64 68 }
65 69 }