fixed conflict handling
This commit is contained in:
		
							parent
							
								
									7590e54392
								
							
						
					
					
						commit
						2c5fcbcbdb
					
				@ -25,7 +25,7 @@ export const addRegion = async (prevstate: any, formData: FormData) => {
 | 
			
		||||
  const confirmedRegion = await db
 | 
			
		||||
    .insert(regions)
 | 
			
		||||
    .values(newRegion.data)
 | 
			
		||||
    .onConflictDoNothing({ target: regions.name })
 | 
			
		||||
    .onConflictDoNothing()
 | 
			
		||||
    .returning({ name: regions.name });
 | 
			
		||||
  if (!confirmedRegion[0]?.name) {
 | 
			
		||||
    return {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user