Added code to update scheduled message status

This commit is contained in:
2026-06-29 15:57:40 -04:00
parent 53016512e0
commit cea2d0cf42
+38
View File
@@ -25,6 +25,34 @@ export const scheduleApi = {
return response.json(); return response.json();
} }
}, },
prepareMessage: async (req, authBearerToken) => {
console.log('Preparing Scheduled message');
const reqBody = {
scheduled_message_id: req.scheduledMessageId,
status: req.status,
};
console.log(`Request body: ${reqBody}`);
const response = await fetch(
`${API_BASE_URL}/api/v1/schedule/status/message/update`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: authBearerToken,
},
body: JSON.stringify(reqBody),
}
);
if (!response.ok) {
throw new Error('Error updating status of scheduled message');
} else {
return response.json();
}
},
}; };
/* /*
@@ -32,3 +60,13 @@ export const scheduleApi = {
"status": "{{status_pending}}", "status": "{{status_pending}}",
"user_id": "{{user_id}}" "user_id": "{{user_id}}"
*/ */
/*
*
*
* {
"scheduled_message_id": "{{scheduled_message_id}}",
"status": "{{status_ready}}"
}
*
*/