15
packages/js/src/queries/sendMessageQuery.ts
Normal file
15
packages/js/src/queries/sendMessageQuery.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { ChatReply, SendMessageInput } from 'models'
|
||||
import { getViewerUrl, sendRequest } from 'utils'
|
||||
|
||||
export async function sendMessageQuery({
|
||||
apiHost,
|
||||
...body
|
||||
}: SendMessageInput & { apiHost?: string }) {
|
||||
const response = await sendRequest<ChatReply>({
|
||||
method: 'POST',
|
||||
url: `${apiHost ?? getViewerUrl()}/api/v1/sendMessage`,
|
||||
body,
|
||||
})
|
||||
|
||||
return response.data
|
||||
}
|
Reference in New Issue
Block a user