diff --git a/hud/hud.js b/hud/hud.js index 6e6c948..d9636f8 100644 --- a/hud/hud.js +++ b/hud/hud.js @@ -93,7 +93,7 @@ const HUD = { } try { - const response = await fetch(`${this.config.apiBaseUrl}/listPending.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/listPending.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -333,7 +333,7 @@ const HUD = { console.log('[HUD] Accepting task:', task.TaskID); try { - const response = await fetch(`${this.config.apiBaseUrl}/accept.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/accept.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -421,7 +421,7 @@ const HUD = { if (!this.chatTaskId) return; try { - const response = await fetch('/api/chat/getMessages.cfm', { + const response = await fetch('/api/chat/getMessages.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -497,7 +497,7 @@ const HUD = { input.disabled = true; try { - const response = await fetch('/api/chat/sendMessage.cfm', { + const response = await fetch('/api/chat/sendMessage.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -538,7 +538,7 @@ const HUD = { if (!confirm('End this chat?')) return; try { - const response = await fetch('/api/tasks/completeChat.cfm', { + const response = await fetch('/api/tasks/completeChat.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ TaskID: this.chatTaskId }) diff --git a/kds/admin.html b/kds/admin.html index fbdf73e..57107bd 100644 --- a/kds/admin.html +++ b/kds/admin.html @@ -259,7 +259,7 @@ async function loadServicePoints() { try { - const response = await fetch(`${API_BASE}/servicepoints/list.cfm`, { + const response = await fetch(`${API_BASE}/servicepoints/list.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: BUSINESS_ID }) @@ -287,7 +287,7 @@ async function loadMenuItems() { try { - const response = await fetch(`${API_BASE}/menu/items.cfm`, { + const response = await fetch(`${API_BASE}/menu/items.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: BUSINESS_ID }) @@ -366,7 +366,7 @@ try { // Step 1: Create cart order (using UserID=1 for admin) - const cartResponse = await fetch(`${API_BASE}/orders/getOrCreateCart.cfm`, { + const cartResponse = await fetch(`${API_BASE}/orders/getOrCreateCart.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -387,7 +387,7 @@ // Step 2: Add items to order for (const item of items) { - const itemResponse = await fetch(`${API_BASE}/orders/setLineItem.cfm`, { + const itemResponse = await fetch(`${API_BASE}/orders/setLineItem.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -407,7 +407,7 @@ } // Step 3: Submit the order - const submitResponse = await fetch(`${API_BASE}/orders/submit.cfm`, { + const submitResponse = await fetch(`${API_BASE}/orders/submit.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ OrderID: orderId }) @@ -442,7 +442,7 @@ } try { - const response = await fetch(`${API_BASE}/orders/updateStatus.cfm`, { + const response = await fetch(`${API_BASE}/orders/updateStatus.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ diff --git a/kds/debug.html b/kds/debug.html index 9b682d0..c9b5b51 100644 --- a/kds/debug.html +++ b/kds/debug.html @@ -24,7 +24,7 @@ const servicePointId = parseInt(document.getElementById('servicePointId').value) || 0; try { - const response = await fetch('/biz.payfrit.com/api/orders/listForKDS.cfm', { + const response = await fetch('/biz.payfrit.com/api/orders/listForKDS.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ diff --git a/kds/kds.js b/kds/kds.js index 49e5fd4..ea8aa9b 100644 --- a/kds/kds.js +++ b/kds/kds.js @@ -126,7 +126,7 @@ async function loadName() { if (!config.businessId) return; try { - const response = await fetch(`${config.apiBaseUrl}/businesses/get.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/businesses/get.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: config.businessId }) @@ -145,7 +145,7 @@ async function loadStations() { if (!config.businessId) return; try { - const response = await fetch(`${config.apiBaseUrl}/stations/list.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/stations/list.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: config.businessId }) @@ -231,7 +231,7 @@ async function loadOrders() { } try { - const url = `${config.apiBaseUrl}/orders/listForKDS.cfm`; + const url = `${config.apiBaseUrl}/orders/listForKDS.php`; const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -480,7 +480,7 @@ function renderActionButtons(order) { // Update order status async function updateOrderStatus(orderId, newStatusId) { try { - const response = await fetch(`${config.apiBaseUrl}/orders/updateStatus.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/orders/updateStatus.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ OrderID: orderId, StatusID: newStatusId }) @@ -500,7 +500,7 @@ async function updateOrderStatus(orderId, newStatusId) { // Mark station's items as done for an order async function markStationDone(orderId) { try { - const response = await fetch(`${config.apiBaseUrl}/orders/markStationDone.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/orders/markStationDone.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ OrderID: orderId, StationID: config.stationId }) diff --git a/portal/menu-builder.html b/portal/menu-builder.html index 683e874..a4cb33f 100644 --- a/portal/menu-builder.html +++ b/portal/menu-builder.html @@ -1364,7 +1364,7 @@ // Load business info async loadBusinessInfo() { try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -3001,7 +3001,7 @@ const pytReward = taskType === 'user' ? parseInt(document.getElementById('pytReward').value) : 0; try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/create.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/create.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -3109,7 +3109,7 @@ formData.append('photo', file); formData.append('ItemID', dbId); - const response = await fetch(`${this.config.apiBaseUrl}/menu/uploadItemPhoto.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/uploadItemPhoto.php`, { method: 'POST', body: formData, credentials: 'include' @@ -3199,7 +3199,7 @@ formData.append('photo', file); formData.append('ItemID', pending.dbId); - const response = await fetch(`${this.config.apiBaseUrl}/menu/uploadItemPhoto.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/uploadItemPhoto.php`, { method: 'POST', body: formData, credentials: 'include' @@ -3599,7 +3599,7 @@ formData.append('header', file); formData.append('BusinessID', this.config.businessId); - const response = await fetch(`${this.config.apiBaseUrl}/menu/uploadHeader.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/uploadHeader.php`, { method: 'POST', body: formData, credentials: 'include' @@ -3762,7 +3762,7 @@ } try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/saveBrandColor.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/saveBrandColor.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -3810,7 +3810,7 @@ payload.MenuID = loadMenuId; } - const response = await fetch(`${this.config.apiBaseUrl}/menu/getForBuilder.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/getForBuilder.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) @@ -4012,7 +4012,7 @@ } try { - const response = await fetch(`${this.config.apiBaseUrl}/menu/menus.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/menus.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -4055,7 +4055,7 @@ } try { - const response = await fetch(`${this.config.apiBaseUrl}/menu/menus.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/menus.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -4079,7 +4079,7 @@ async setDefaultMenu(menuId) { try { - const response = await fetch(`${this.config.apiBaseUrl}/menu/menus.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/menus.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -4161,7 +4161,7 @@ }; console.log('[MenuBuilder] Full payload:', JSON.stringify(payload, null, 2)); - const response = await fetch(`${this.config.apiBaseUrl}/menu/saveFromBuilder.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/saveFromBuilder.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) diff --git a/portal/portal.js b/portal/portal.js index fe5d5be..d81ee28 100644 --- a/portal/portal.js +++ b/portal/portal.js @@ -75,7 +75,7 @@ const Portal = { // Verify user has access to this business (or get their businesses if none selected) try { - const response = await fetch(`${this.config.apiBaseUrl}/portal/myBusinesses.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/portal/myBusinesses.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -116,7 +116,7 @@ const Portal = { // Fetch actual business info try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -157,7 +157,7 @@ const Portal = { const userId = localStorage.getItem('payfrit_portal_userid'); try { - const response = await fetch(`${this.config.apiBaseUrl}/portal/myBusinesses.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/portal/myBusinesses.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-User-Token': token }, body: JSON.stringify({ UserID: userId }) @@ -372,7 +372,7 @@ const Portal = { // Fetch stats async fetchStats() { - const response = await fetch(`${this.config.apiBaseUrl}/portal/stats.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/portal/stats.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -384,7 +384,7 @@ const Portal = { // Fetch recent orders async fetchRecentOrders() { - const response = await fetch(`${this.config.apiBaseUrl}/orders/listForKDS.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/orders/listForKDS.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -442,7 +442,7 @@ const Portal = { console.log('[Portal] Loading orders...'); try { - const response = await fetch(`${this.config.apiBaseUrl}/orders/listForKDS.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/orders/listForKDS.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -631,7 +631,7 @@ const Portal = { this.loadHiringToggle(); try { - const url = `${this.config.apiBaseUrl}/portal/team.cfm`; + const url = `${this.config.apiBaseUrl}/portal/team.php`; console.log('[Portal] Fetching team from:', url); const response = await fetch(url, { method: 'POST', @@ -702,7 +702,7 @@ const Portal = { // Refresh business data async refreshBusinessData() { try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -725,7 +725,7 @@ const Portal = { async toggleHiring(isHiring) { console.log('[Portal] Setting hiring to:', isHiring); try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/setHiring.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/setHiring.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -779,7 +779,7 @@ const Portal = { // Load states for dropdown async loadStatesDropdown() { try { - const response = await fetch(`${this.config.apiBaseUrl}/addresses/states.cfm`); + const response = await fetch(`${this.config.apiBaseUrl}/addresses/states.php`); const data = await response.json(); if (data.OK && data.STATES) { @@ -797,7 +797,7 @@ const Portal = { // Load business info for settings async loadBusinessInfo() { try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -885,7 +885,7 @@ const Portal = { const tabDetails = document.getElementById('tabSettingsDetails'); if (tabDetails) tabDetails.style.display = tabsEnabled ? 'block' : 'none'; try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/updateTabs.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/updateTabs.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -915,7 +915,7 @@ const Portal = { const types = ['1']; // Dine-in always enabled if (document.getElementById('orderTypeTakeaway').checked) types.push('2'); try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/saveOrderTypes.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/saveOrderTypes.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Business-ID': this.config.businessId }, body: JSON.stringify({ BusinessID: this.config.businessId, OrderTypes: types.join(',') }) @@ -1006,7 +1006,7 @@ const Portal = { btn.disabled = true; try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/update.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/update.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -1056,7 +1056,7 @@ const Portal = { }); try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/updateHours.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/updateHours.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -1083,7 +1083,7 @@ const Portal = { const statusContainer = document.getElementById('stripeStatus'); try { - const response = await fetch(`${this.config.apiBaseUrl}/stripe/status.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/stripe/status.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -1283,7 +1283,7 @@ const Portal = { this.toast('Starting Stripe setup...', 'info'); try { - const response = await fetch(`${this.config.apiBaseUrl}/stripe/onboard.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/stripe/onboard.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -1323,7 +1323,7 @@ const Portal = { formData.append('header', file); try { - const response = await fetch(`${this.config.apiBaseUrl}/menu/uploadHeader.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/uploadHeader.php`, { method: 'POST', body: formData }); @@ -1441,7 +1441,7 @@ const Portal = { } try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/saveBrandColor.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/saveBrandColor.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId, BrandColor: color, BrandColorLight: lightColor }) @@ -1471,7 +1471,7 @@ const Portal = { this.toast('Loading order...', 'info'); try { - const response = await fetch(`${this.config.apiBaseUrl}/orders/getDetail.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/orders/getDetail.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ OrderID: orderId }) @@ -1676,7 +1676,7 @@ const Portal = { btn.disabled = true; btn.textContent = 'Adding...'; try { - const response = await fetch(`${this.config.apiBaseUrl}/portal/addTeamMember.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/portal/addTeamMember.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -1706,7 +1706,7 @@ const Portal = { btn.textContent = 'Searching...'; try { - const response = await fetch(`${this.config.apiBaseUrl}/portal/searchUser.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/portal/searchUser.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ Query: contact, BusinessID: this.config.businessId }) @@ -1768,7 +1768,7 @@ const Portal = { async loadBeacons() { const container = document.getElementById('beaconsList'); try { - const response = await fetch(`${this.config.apiBaseUrl}/beacons/list.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/beacons/list.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -1820,7 +1820,7 @@ const Portal = { // Load service points list async loadServicePoints() { try { - const response = await fetch(`${this.config.apiBaseUrl}/servicepoints/list.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/servicepoints/list.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -1865,7 +1865,7 @@ const Portal = { async loadAssignments() { const container = document.getElementById('assignmentsList'); try { - const response = await fetch(`${this.config.apiBaseUrl}/assignments/list.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/assignments/list.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -1957,7 +1957,7 @@ const Portal = { } try { - const response = await fetch(`${this.config.apiBaseUrl}/beacons/save.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/beacons/save.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -1991,7 +1991,7 @@ const Portal = { if (!confirm('Are you sure you want to remove this beacon?')) return; try { - const response = await fetch(`${this.config.apiBaseUrl}/beacons/delete.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/beacons/delete.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -2055,7 +2055,7 @@ const Portal = { } try { - const response = await fetch(`${this.config.apiBaseUrl}/servicepoints/save.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/servicepoints/save.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -2089,7 +2089,7 @@ const Portal = { if (!confirm('Are you sure you want to deactivate this service point?')) return; try { - const response = await fetch(`${this.config.apiBaseUrl}/servicepoints/delete.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/servicepoints/delete.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -2171,7 +2171,7 @@ const Portal = { }; try { - const response = await fetch(`${this.config.apiBaseUrl}/assignments/save.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/assignments/save.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -2200,7 +2200,7 @@ const Portal = { if (!confirm('Are you sure you want to remove this assignment?')) return; try { - const response = await fetch(`${this.config.apiBaseUrl}/assignments/delete.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/assignments/delete.php`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -2338,7 +2338,7 @@ const Portal = { async loadServiceTypes() { try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/listAllTypes.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/listAllTypes.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -2459,7 +2459,7 @@ const Portal = { const order = [...items].map(item => parseInt(item.dataset.id)); try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/reorderTypes.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/reorderTypes.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -2610,7 +2610,7 @@ const Portal = { }; try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/saveType.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/saveType.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) @@ -2731,7 +2731,7 @@ const Portal = { }; try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/saveType.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/saveType.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) @@ -2755,7 +2755,7 @@ const Portal = { if (!confirm(`Delete "${serviceName}"? This cannot be undone.`)) return; try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/deleteType.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/deleteType.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -2798,7 +2798,7 @@ const Portal = { // Task Categories async loadTaskCategories() { try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/listCategories.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/listCategories.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -2842,7 +2842,7 @@ const Portal = { async seedDefaultCategories() { try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/seedCategories.cfm?bid=${this.config.businessId}`); + const response = await fetch(`${this.config.apiBaseUrl}/tasks/seedCategories.php?bid=${this.config.businessId}`); const data = await response.json(); if (data.OK) { this.toast(data.MESSAGE || 'Categories created!', 'success'); @@ -2913,7 +2913,7 @@ const Portal = { if (id) payload.TaskCategoryID = parseInt(id); try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/saveCategory.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/saveCategory.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) @@ -2936,7 +2936,7 @@ const Portal = { if (!confirm('Delete this category?')) return; try { - const response = await fetch(`${this.config.apiBaseUrl}/tasks/deleteCategory.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/tasks/deleteCategory.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -3866,7 +3866,7 @@ const Portal = { if (!container) return; try { - const response = await fetch(`${this.config.apiBaseUrl}/ratings/listForAdmin.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/ratings/listForAdmin.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -3975,7 +3975,7 @@ const Portal = { const continueAllow = document.getElementById('ratingContinueAllow').checked; try { - const response = await fetch(`${this.config.apiBaseUrl}/ratings/createAdminRating.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/ratings/createAdminRating.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ diff --git a/portal/setup-wizard.html b/portal/setup-wizard.html index 7f373e2..796c861 100644 --- a/portal/setup-wizard.html +++ b/portal/setup-wizard.html @@ -1401,7 +1401,7 @@ `); try { - const response = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuUrl.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuUrl.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url }) @@ -1493,8 +1493,8 @@ const formData = new FormData(); formData.append('zipFile', file); - console.log('Uploading ZIP to:', `${config.apiBaseUrl}/setup/uploadSavedPage.cfm`); - const uploadResponse = await fetch(`${config.apiBaseUrl}/setup/uploadSavedPage.cfm`, { + console.log('Uploading ZIP to:', `${config.apiBaseUrl}/setup/uploadSavedPage.php`); + const uploadResponse = await fetch(`${config.apiBaseUrl}/setup/uploadSavedPage.php`, { method: 'POST', body: formData }); @@ -1533,7 +1533,7 @@ `); // Now analyze the extracted URL with Playwright - const response = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuUrl.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuUrl.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url: uploadResult.URL }) @@ -1549,7 +1549,7 @@ const htmlContent = await file.text(); console.log('Sending HTML content, length:', htmlContent.length); - const response = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuUrl.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuUrl.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ html: htmlContent }) @@ -1813,7 +1813,7 @@ }); formData.append('businessId', config.businessId); - const response = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuImages.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/setup/analyzeMenuImages.php`, { method: 'POST', body: formData }); @@ -2000,7 +2000,7 @@ // Check for duplicate businesses before creating a new one async function checkForDuplicateBusiness(biz) { try { - const response = await fetch(`${config.apiBaseUrl}/setup/checkDuplicate.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/setup/checkDuplicate.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -2271,7 +2271,7 @@ if (!taxInput) return; try { - const resp = await fetch(`/api/setup/lookupTaxRate.cfm?zip=${encodeURIComponent(zipCode)}`); + const resp = await fetch(`/api/setup/lookupTaxRate.php?zip=${encodeURIComponent(zipCode)}`); const data = await resp.json(); if (data.OK && data.taxRate > 0) { @@ -3182,7 +3182,7 @@ saveBtn.disabled = true; try { - const response = await fetch(`${config.apiBaseUrl}/setup/saveWizard.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/setup/saveWizard.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -3243,7 +3243,7 @@ formData.append('BusinessID', finalBusinessId); formData.append('header', config.headerImageFile); - const headerResp = await fetch(`${config.apiBaseUrl}/menu/uploadHeader.cfm`, { + const headerResp = await fetch(`${config.apiBaseUrl}/menu/uploadHeader.php`, { method: 'POST', body: formData }); @@ -3292,7 +3292,7 @@ formData.append('ItemID', dbItemId); formData.append('photo', file); - const imgResp = await fetch(`${config.apiBaseUrl}/menu/uploadItemPhoto.cfm`, { + const imgResp = await fetch(`${config.apiBaseUrl}/menu/uploadItemPhoto.php`, { method: 'POST', body: formData }); @@ -3512,7 +3512,7 @@ async function loadBusinessInfo() { try { - const response = await fetch(`${config.apiBaseUrl}/businesses/get.cfm`, { + const response = await fetch(`${config.apiBaseUrl}/businesses/get.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: config.businessId }) diff --git a/portal/signup.html b/portal/signup.html index a31baab..86e4ebe 100644 --- a/portal/signup.html +++ b/portal/signup.html @@ -553,7 +553,7 @@ try { // First try login (existing user) - const loginResponse = await fetch(BASE_PATH + '/api/auth/loginOTP.cfm', { + const loginResponse = await fetch(BASE_PATH + '/api/auth/loginOTP.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ phone: this.phone }) @@ -574,7 +574,7 @@ if (loginData.ERROR === 'no_account') { // New user - signup flow - const signupResponse = await fetch(BASE_PATH + '/api/auth/sendOTP.cfm', { + const signupResponse = await fetch(BASE_PATH + '/api/auth/sendOTP.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ phone: this.phone }) @@ -656,7 +656,7 @@ }, async resendOTP() { - const endpoint = this.isExistingUser ? '/api/auth/loginOTP.cfm' : '/api/auth/sendOTP.cfm'; + const endpoint = this.isExistingUser ? '/api/auth/loginOTP.php' : '/api/auth/sendOTP.php'; try { const response = await fetch(BASE_PATH + endpoint, { @@ -697,7 +697,7 @@ btn.disabled = true; btn.textContent = 'Verifying...'; - const endpoint = this.isExistingUser ? '/api/auth/verifyLoginOTP.cfm' : '/api/auth/verifyOTP.cfm'; + const endpoint = this.isExistingUser ? '/api/auth/verifyLoginOTP.php' : '/api/auth/verifyOTP.php'; try { const response = await fetch(BASE_PATH + endpoint, { @@ -762,7 +762,7 @@ btn.textContent = 'Completing...'; try { - const response = await fetch(BASE_PATH + '/api/auth/completeProfile.cfm', { + const response = await fetch(BASE_PATH + '/api/auth/completeProfile.php', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -792,7 +792,7 @@ async checkBusinessesAndRedirect() { try { - const response = await fetch(BASE_PATH + '/api/portal/myBusinesses.cfm', { + const response = await fetch(BASE_PATH + '/api/portal/myBusinesses.php', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/portal/station-assignment.html b/portal/station-assignment.html index e86de30..62ffc3f 100644 --- a/portal/station-assignment.html +++ b/portal/station-assignment.html @@ -540,7 +540,7 @@ async loadBusinessInfo() { try { - const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/businesses/get.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -558,7 +558,7 @@ async loadStations() { try { - const response = await fetch(`${this.config.apiBaseUrl}/stations/list.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/stations/list.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -578,7 +578,7 @@ async loadItems() { console.log('[StationAssignment] Loading items for BusinessID:', this.config.businessId); try { - const response = await fetch(`${this.config.apiBaseUrl}/menu/items.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/items.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId }) @@ -902,7 +902,7 @@ StationID: stationId })); - const response = await fetch(`${this.config.apiBaseUrl}/menu/updateStations.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/menu/updateStations.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -930,7 +930,7 @@ const color = '#' + Math.floor(Math.random()*16777215).toString(16).padStart(6, '0'); try { - const response = await fetch(`${this.config.apiBaseUrl}/stations/save.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/stations/save.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId, Name: name.trim(), Color: color }) @@ -957,7 +957,7 @@ if (name === null || !name.trim()) return; try { - const response = await fetch(`${this.config.apiBaseUrl}/stations/save.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/stations/save.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId, StationID: stationId, Name: name.trim(), Color: station.Color }) @@ -983,7 +983,7 @@ if (!confirm(`Delete station "${station.Name}"? Items assigned to it will become unassigned.`)) return; try { - const response = await fetch(`${this.config.apiBaseUrl}/stations/delete.cfm`, { + const response = await fetch(`${this.config.apiBaseUrl}/stations/delete.php`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ BusinessID: this.config.businessId, StationID: stationId })