Code formatting

This commit is contained in:
2026-06-29 15:51:26 -04:00
parent 795a756975
commit 53016512e0
2 changed files with 47 additions and 46 deletions
+22 -23
View File
@@ -1,31 +1,30 @@
import { API_BASE_URL } from '../constants/api';
export const scheduleApi = {
scheduleMessage: async (s, authBearerToken) => {
console.log('Scheduling message');
const reqBody = {
scheduled: s.scheduedTime.toISOString(),
status: s.status,
user_id: s.userId,
};
scheduleMessage: async (s, authBearerToken) => {
console.log('Scheduling message');
const reqBody = {
scheduled: s.scheduedTime.toISOString(),
status: s.status,
user_id: s.userId,
};
console.log(`Request body: ${reqBody}`);
const response = await fetch(`${API_BASE_URL}/api/v1/schedule/message`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: authBearerToken,
},
body: JSON.stringify(reqBody)
});
console.log(`Request body: ${reqBody}`);
const response = await fetch(`${API_BASE_URL}/api/v1/schedule/message`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: authBearerToken,
},
body: JSON.stringify(reqBody),
});
if (!response.ok) {
throw new Error('Error scheduling message');
} else {
return response.json();
}
}
if (!response.ok) {
throw new Error('Error scheduling message');
} else {
return response.json();
}
},
};
/*
+25 -23
View File
@@ -1,31 +1,33 @@
import { API_BASE_URL } from '../constants/api';
export const scheduleEventApi = {
scheduleMessageEvent: async (s, authBearerToken) => {
console.log('Scheduling message Event');
const reqBody = {
contact_id: s.contactId,
message_id: s.messageId,
scheduled_message_id: s.scheduledMessageId,
};
scheduleMessageEvent: async (s, authBearerToken) => {
console.log('Scheduling message Event');
const reqBody = {
contact_id: s.contactId,
message_id: s.messageId,
scheduled_message_id: s.scheduledMessageId,
};
console.log(`Request body: ${reqBody}`);
const response = await fetch(`${API_BASE_URL}/api/v1/schedule/message/event`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: authBearerToken,
},
body: JSON.stringify(reqBody)
});
console.log(`Request body: ${reqBody}`);
const response = await fetch(
`${API_BASE_URL}/api/v1/schedule/message/event`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: authBearerToken,
},
body: JSON.stringify(reqBody),
}
);
if (!response.ok) {
throw new Error('Error scheduling message event');
} else {
return response.json();
}
}
if (!response.ok) {
throw new Error('Error scheduling message event');
} else {
return response.json();
}
},
};
/*