11 lines
537 B
TypeScript
11 lines
537 B
TypeScript
import { callWorker } from './workerClient';
|
|
import type { ChannelInfo } from './types';
|
|
import type { ParsedChannelLink } from '@/lib/channelLink';
|
|
import type { MemberBody } from './generated/api';
|
|
const apiBase = import.meta.env.VITE_WEBDROP_API_URL ?? '/api/v1';
|
|
export type ChannelMember = MemberBody;
|
|
export const channelAccessApi = {
|
|
members: (id: string) => callWorker<ChannelMember[]>('channelMembers', { id, apiBase }),
|
|
preview: (link: ParsedChannelLink) => callWorker<ChannelInfo>('previewChannel', { link, apiBase }),
|
|
};
|