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