File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
apps/studio/components/interfaces/Integrations/CronJobs Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -305,18 +305,20 @@ export const CreateCronJobSheet = ({
305305 const onSubmit : SubmitHandler < CreateCronJobForm > = async ( { name, schedule, values } ) => {
306306 if ( ! project ) return console . error ( 'Project is required' )
307307
308- const checkExistingJob = await getDatabaseCronJob ( {
309- projectRef : project . ref ,
310- connectionString : project . connectionString ,
311- name,
312- } )
313- const nameExists = ! ! checkExistingJob
314-
315- if ( nameExists ) {
316- return form . setError ( 'name' , {
317- type : 'manual' ,
318- message : 'A cron job with this name already exists' ,
308+ if ( ! isEditing ) {
309+ const checkExistingJob = await getDatabaseCronJob ( {
310+ projectRef : project . ref ,
311+ connectionString : project . connectionString ,
312+ name,
319313 } )
314+ const nameExists = ! ! checkExistingJob
315+
316+ if ( nameExists ) {
317+ return form . setError ( 'name' , {
318+ type : 'manual' ,
319+ message : 'A cron job with this name already exists' ,
320+ } )
321+ }
320322 }
321323
322324 const command = `$$${ values . snippet } $$`
You can’t perform that action at this time.
0 commit comments