webapp/src/stores/inbox.ts
2022-11-23 07:12:11 +03:00

14 lines
427 B
TypeScript

import { createSignal } from 'solid-js'
import type { Chat } from '../graphql/types.gen'
import { apiClient } from '../utils/apiClient'
export const [chats, setChats] = createSignal<Chat[]>([])
export const loadAuthorsBy = async (by?: any): Promise<void> => {
return await apiClient.getAuthorsBy({ by })
}
export const loadChats = async (): Promise<void> => {
return await apiClient.getChats({ limit: 0, offset: 50 })
}