Skip to content

Commit

Permalink
⚠️ react/hooks: Fix chat lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lowczarc committed Dec 29, 2023
1 parent 42f8051 commit 82ebce4
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 362 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
workflow_run:
workflows: [CI]
types: [completed]

jobs:
build:
Expand Down
12 changes: 6 additions & 6 deletions lib/chats/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export async function getChatList(
getToken: () => Promise<string>,
clientOptions: InputClientOptions = {},
): Promise<ChatInfos[]> {
const token = await getToken();
const { token, endpoint } = await defaultOptions(clientOptions);

return fetch(`https://api.polyfire.com/chats`, {
return fetch(`${endpoint}/chats`, {
method: "GET",
headers: {
"X-Access-Token": token,
Expand All @@ -87,9 +87,9 @@ export async function deleteChat(
getToken: () => Promise<string>,
clientOptions: InputClientOptions = {},
): Promise<boolean> {
const token = await getToken();
const { token, endpoint } = await defaultOptions(clientOptions);

return fetch(`https://api.polyfire.com/chat/${chatId}`, {
return fetch(`${endpoint}/chat/${chatId}`, {
method: "DELETE",
headers: {
"X-Access-Token": token,
Expand All @@ -106,9 +106,9 @@ export async function renameChat(
getToken: () => Promise<string>,
clientOptions: InputClientOptions = {},
): Promise<boolean> {
const token = await getToken();
const { token, endpoint } = await defaultOptions(clientOptions);

return fetch(`https://api.polyfire.com/chat/${chatId}`, {
return fetch(`${endpoint}/chat/${chatId}`, {
method: "PUT",
headers: {
"X-Access-Token": token,
Expand Down
Loading

0 comments on commit 82ebce4

Please sign in to comment.