Fixed share url save.

This commit is contained in:
Mike Cao committed 2025-02-03 13:56:30 -08:00
1 parent b3f8bbe3fc
commit 7d952029c1
3 files changed
+8 -4

No files matched your search

@@ -35,7 +35,11 @@ export function ShareUrl({ hostUrl, onSave }: { hostUrl?: string; onSave?: () =>
};
const handleCheck = (checked: boolean) => {
const data = { name: website.name, shareId: checked ? generateId() : null };
const data = {
name: website.name,
domain: website.domain,
shareId: checked ? generateId() : null,
};
mutate(data, {
onSuccess: async () => {
touch(`website:${website.id}`);
@@ -47,7 +51,7 @@ export function ShareUrl({ hostUrl, onSave }: { hostUrl?: string; onSave?: () =>
const handleSave = () => {
mutate(
{ shareId: id },
{ name: website.name, domain: website.domain, shareId: id },
{
onSuccess: async () => {
touch(`website:${website.id}`);
+1 -1
View File
@@ -12,7 +12,7 @@ export function usePagedQuery<T = any>({
const { query: queryParams } = useNavigation();
const [params, setParams] = useState<PageParams>({
search: '',
page: +queryParams.page || 1,
page: queryParams.page || '1',
});
const { useQuery } = useApi();
+1 -1
View File
@@ -41,7 +41,7 @@ export interface PageResult<T> {
export interface PagedQueryResult<T> {
result: PageResult<T>;
search: any;
query: any;
params: PageParams;
setParams: Dispatch<SetStateAction<T | PageParams>>;
}