Browse Source

Use auth'ed admin chat messages endpoint to get history

pull/1886/head
Gabe Kangas 6 years ago
parent
commit
5345c124aa
  1. 2
      web/pages/chat.tsx
  2. 2
      web/utils/apis.ts

2
web/pages/chat.tsx

@ -48,7 +48,7 @@ export default function Chat() {
const getInfo = async () => { const getInfo = async () => {
try { try {
const result = await fetchData(CHAT_HISTORY, { auth: false }); const result = await fetchData(CHAT_HISTORY, { auth: true });
setMessages(result); setMessages(result);
} catch (error) { } catch (error) {
console.log("==== error", error); console.log("==== error", error);

2
web/utils/apis.ts

@ -35,7 +35,7 @@ export const LOGS_ALL = `${API_LOCATION}logs`;
export const LOGS_WARN = `${API_LOCATION}logs/warnings`; export const LOGS_WARN = `${API_LOCATION}logs/warnings`;
// Get chat history // Get chat history
export const CHAT_HISTORY = `${NEXT_PUBLIC_API_HOST}api/chat`; export const CHAT_HISTORY = `${API_LOCATION}chat/messages`;
// Get chat history // Get chat history
export const UPDATE_CHAT_MESSGAE_VIZ = `${NEXT_PUBLIC_API_HOST}api/admin/chat/updatemessagevisibility`; export const UPDATE_CHAT_MESSGAE_VIZ = `${NEXT_PUBLIC_API_HOST}api/admin/chat/updatemessagevisibility`;

Loading…
Cancel
Save