rubber-blueR
Refine17mo ago
12 replies
rubber-blue

useApiUrl breaking code

import { getValueFromEvent, useModalForm, useSelect } from "@refinedev/antd";
import { useApiUrl, useGo } from "@refinedev/core";
import { Form, Modal, Input, Divider, Upload } from "antd";
import { supabaseClient } from "../../utility";

const JobCreate = () => {
const go = useGo();
const apiUrl = useApiUrl();
const goToListPage = () => {
go({
to: { resource: "jobs", action: "list" },
options: {
keepQuery: true,
},
type: "replace",
});
};

const { formProps, modalProps } = useModalForm({
resource: "jobs",
action: "create",
onMutationSuccess: goToListPage,
defaultVisible: true,
redirect: false,
});


return (
<>
<Modal
{...modalProps}
mask={true}
width={560}
destroyOnClose
onCancel={goToListPage}
title={"Create Job"}
>
<Divider />
<Form {...formProps} layout="vertical">
<Form.Item label="Image">
<Form.Item
name="files"
valuePropName="fileList"
getValueFromEvent={getValueFromEvent}
noStyle
>
<Upload.Dragger
name="file"
action={""}
listType="picture"
maxCount={5}
multiple
>
<p className="ant-upload-text">
Drag & drop a file in this area
</p>
</Upload.Dragger>
</Form.Item>
</Form.Item>
</Form>
<Divider />
</Modal>
</>
);
};

export default JobCreate;

why am getting error Not implemented on refine-supabase data provider when using useApiUrl
Was this page helpful?