refactor to make a little more sense at a glance

This commit is contained in:
2025-06-30 17:19:24 -04:00
parent 396ef9d2be
commit c4a5de31f3

View File

@ -116,7 +116,8 @@ const generateOllamaRequest = async (
}); });
const ollamaResponse: OllamaResponse = await response.json(); const ollamaResponse: OllamaResponse = await response.json();
await storePromptData(notification, ollamaResponse); await storePromptData(notification, ollamaResponse);
await postReplyToStatus(notification, ollamaResponse); // await postReplyToStatus(notification, ollamaResponse);
return ollamaResponse;
} }
} catch (error: any) { } catch (error: any) {
throw new Error(error.message); throw new Error(error.message);
@ -166,8 +167,11 @@ const postReplyToStatus = async (
if (notifications) { if (notifications) {
await Promise.all( await Promise.all(
notifications.map((notification) => { notifications.map(async (notification) => {
generateOllamaRequest(notification); const ollamaResponse = await generateOllamaRequest(notification);
if (ollamaResponse) {
postReplyToStatus(notification, ollamaResponse);
}
}) })
); );
} }