MCPcopy Create free account
hub / github.com/EpistasisLab/KRAGEN / patchChatToDB

Function patchChatToDB

KRAGEN_Dashboard/Frontend/src/components/apiService.js:789–822  ·  view source on GitHub ↗
(
  current_chatTapID,
  id_in_chatTap,
  message,
  message_type,
  who
)

Source from the content-addressed store, hash-verified

787}
788
789async function patchChatToDB(
790 current_chatTapID,
791 id_in_chatTap,
792 message,
793 message_type,
794 who
795) {
796 // console.log("current_chatTapID-last", current_chatTapID);
797 // console.log("message-last", message);
798
799 await fetch(
800 // `/chatapi/v1/chatlogs/${current_chatTapID}`,
801 // `/chatapi/v1/chats/${current_chatTapID}/chatlogs/${id_in_chatTap}`,
802 `${apiUrl}:${apiPort}/chatapi/v1/chats/${current_chatTapID}/chatlogs/${id_in_chatTap}`,
803 {
804 method: "PATCH",
805 headers: {
806 "Content-Type": "application/json",
807 },
808 body: JSON.stringify({
809 message: message,
810 message_type: message_type,
811 who: who,
812 }),
813 }
814 )
815 .then((res) => res.json())
816 .then((data) => {
817 console.log("data--best--patchChatlog", data);
818 })
819 .catch((err) => {
820 console.log("err--best--patchChatlog", err);
821 });
822}
823
824async function getFilesURLs(file_id) {
825 console.log("step-1.getFiles");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected