Code formatting
This commit is contained in:
+22
-23
@@ -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
@@ -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();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user