equal-aqua
equal-aqua•2w ago

I have been trying to ask the ai/support bot how to assign an error message when using the supabase

I have been trying to ask the ai/support bot how to assign an error message when using the supabase dataprovider and not having any luck. Basically I am using the Supabase dataprovider, I have a form that has a field called slug, the server will throw an error if it is a duplicate, I want the async form validation to have a friendly description attached to the field. Right now this is what I have
const { modalProps, formProps, onFinish, close, form } = useModalForm<any>({
action: "create",
resource: "sites",
defaultVisible: true,
redirect: false,
mutationMode: "pessimistic",
defaultFormValues: {
is_active: true,
},
createMutationOptions:{

onError: async (error: HttpError, variables, context) => {
console.error(error);

form.setFields([
{
name: 'slug',
errors: ['Slug error' ],
},
]);

// Handle other errors if needed
return Promise.reject(error);
}
}
});
const { modalProps, formProps, onFinish, close, form } = useModalForm<any>({
action: "create",
resource: "sites",
defaultVisible: true,
redirect: false,
mutationMode: "pessimistic",
defaultFormValues: {
is_active: true,
},
createMutationOptions:{

onError: async (error: HttpError, variables, context) => {
console.error(error);

form.setFields([
{
name: 'slug',
errors: ['Slug error' ],
},
]);

// Handle other errors if needed
return Promise.reject(error);
}
}
});
I have tried variations of this, is the only option to create a custom data provider and handle it in the create? Is there no overrides in the supabase data provider for this kind of handling?
13 Replies
equal-aqua
equal-aqua•2w ago
I guess the only option is to create custom data providers for every resource that needs this type of validation
rare-sapphire
rare-sapphire•2w ago
Hi everyone, I am looking for remote opportunities. Could anyone point me in the right direction?
probable-pink
probable-pink•2w ago
Hey guys, thanks for the library! I got a question regarding hasura provider. I got this error 'can not read properties of undefined, reading aggregate'. I believe it's because i have multiple query_roots in hasura, so the graphql response was something like this -> data.root_name{post, aggregate}. And I believe it should be just -> data{post, aggregate} how do i go about this guys? thanks!
grumpy-cyan
grumpy-cyan•2w ago
Hi guys,I am a senior full stack developer. I am looking for an upwork account in USA, Canada, or Mexico.If you do not have account, I can create your account remotely. I know the way how to create account. If you are living in US or Canada or Mexico, I welcome you. To make account you have to do phone verify and ID card verify in your computer. I need your help for this too. After creating account, I want you turn on your computer 24/7 so I can work in your computer remotely. I am ready to pay $100-$150 per month and also share some income from upwork. I CAN PAY AFTER USING YOUR ACCOUNT ONE MONTH. I want to use Anydesk to access your computer remotely and I only need Chrome browser. If you are interested in my offer, please DM me. I am looking for long term collaboration. I am looking forward to working with you. With all my best regards, Thanks
probable-pink
probable-pink•2w ago
nvm, found it, solve it using responseMiddleWare
eastern-cyan
eastern-cyan•6d ago
Hello! I have question about refine table filtration. When I select something and filter, I have filtration and updated URL, like here http://localhost:3002/app/customer-ratings-output?pageSize=10&current=1&filters[0][field]=customerName&filters[0][value]=Investmanagenent%20LLC.&filters[0][operator]=contains but when I click on cross and want to remove filtration, It is not working. How It can be fixed?
eastern-cyan
eastern-cyan•6d ago
is this useTable hook filter?
eastern-cyan
eastern-cyan•6d ago
I just use DataGrid from mui/x-data-grid
eastern-cyan
eastern-cyan•6d ago
I mean how this filter is defined. from which hook? and please send some code to us actually it would be better if you create a thread
dependent-tan
dependent-tan•6d ago
I know the refine hr template is still under development but I was just wondering wat UI framework does it use? ah for anyone wondering, it looks like shadcn
absent-sapphire
absent-sapphire•4d ago
Did anyone build a schema copy of the CRM demo database into supabase ? 😮 I'll be happy to pay for it
absent-sapphire
absent-sapphire•3d ago
Hello everyone! I have a question. Whenever I try to work on a problem with a specific stack, like if I want to work on base-antd, I use this command:
pnpm dev --scope @refinedev/antd --scope base-antd
pnpm dev --scope @refinedev/antd --scope base-antd
or any other framework. I go through pnpm-lock.yaml and work on that particular base example. I've also tried setting up a custom project using the CLI and npm link to link the local package. I wanted to know if there is a faster or better way to quickly reproduce an issue?
underlying-yellow
underlying-yellow•3d ago
That’s not difficult, man! - Export data from the CRM demo database; pg_dump --data-only --column-inserts --no-owner --no-acl -h localhost -p 5432 -U dr.nefario -d crm_db > crm_data.sql - Import data into Supabase; psql --host=db.nefario_suphost.supabase.co --port=5432 --username=dr.nefario --password --dbname=*** -f crm_data.sql Outside of that, it may need more operations based on your requirements and project characteristics. 😉 Still I am supporting you!