webapp/src/stores/inbox.ts

14 lines
427 B
TypeScript
Raw Normal View History

2022-11-13 06:41:04 +00:00
import { createSignal } from 'solid-js'
2022-11-09 17:57:35 +00:00
import type { Chat } from '../graphql/types.gen'
2022-11-23 04:12:11 +00:00
import { apiClient } from '../utils/apiClient'
2022-10-05 08:55:26 +00:00
2022-11-13 06:41:04 +00:00
export const [chats, setChats] = createSignal<Chat[]>([])
2022-11-23 04:12:11 +00:00
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 })
}