Fixed share url save.
This commit is contained in:
@@ -35,7 +35,11 @@ export function ShareUrl({ hostUrl, onSave }: { hostUrl?: string; onSave?: () =>
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCheck = (checked: boolean) => {
|
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, {
|
mutate(data, {
|
||||||
onSuccess: async () => {
|
onSuccess: async () => {
|
||||||
touch(`website:${website.id}`);
|
touch(`website:${website.id}`);
|
||||||
@@ -47,7 +51,7 @@ export function ShareUrl({ hostUrl, onSave }: { hostUrl?: string; onSave?: () =>
|
|||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
mutate(
|
mutate(
|
||||||
{ shareId: id },
|
{ name: website.name, domain: website.domain, shareId: id },
|
||||||
{
|
{
|
||||||
onSuccess: async () => {
|
onSuccess: async () => {
|
||||||
touch(`website:${website.id}`);
|
touch(`website:${website.id}`);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function usePagedQuery<T = any>({
|
|||||||
const { query: queryParams } = useNavigation();
|
const { query: queryParams } = useNavigation();
|
||||||
const [params, setParams] = useState<PageParams>({
|
const [params, setParams] = useState<PageParams>({
|
||||||
search: '',
|
search: '',
|
||||||
page: +queryParams.page || 1,
|
page: queryParams.page || '1',
|
||||||
});
|
});
|
||||||
|
|
||||||
const { useQuery } = useApi();
|
const { useQuery } = useApi();
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export interface PageResult<T> {
|
|||||||
|
|
||||||
export interface PagedQueryResult<T> {
|
export interface PagedQueryResult<T> {
|
||||||
result: PageResult<T>;
|
result: PageResult<T>;
|
||||||
search: any;
|
query: any;
|
||||||
params: PageParams;
|
params: PageParams;
|
||||||
setParams: Dispatch<SetStateAction<T | PageParams>>;
|
setParams: Dispatch<SetStateAction<T | PageParams>>;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user