2023-09-04 17:18:43 +00:00
|
|
|
import { queryClient } from '../cache';
|
|
|
|
import { request } from '../request';
|
2023-10-24 16:17:18 +00:00
|
|
|
import { AppRouterOutput } from '../trpc';
|
2023-09-04 17:18:43 +00:00
|
|
|
|
2023-10-24 16:17:18 +00:00
|
|
|
export type WebsiteInfo = NonNullable<AppRouterOutput['website']['info']>;
|
2023-09-04 17:18:43 +00:00
|
|
|
|
2023-09-06 06:14:12 +00:00
|
|
|
export async function deleteWorkspaceWebsite(
|
|
|
|
workspaceId: string,
|
|
|
|
websiteId: string
|
|
|
|
) {
|
|
|
|
await request.delete(`/api/workspace/${workspaceId}/website/${websiteId}`);
|
|
|
|
|
|
|
|
queryClient.resetQueries(['websites', workspaceId]);
|
|
|
|
}
|
|
|
|
|
2023-09-04 17:18:43 +00:00
|
|
|
export function refreshWorkspaceWebsites(workspaceId: string) {
|
|
|
|
queryClient.refetchQueries(['websites', workspaceId]);
|
|
|
|
}
|