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
|
const confirmedRegion = await db
|
||||||
.insert(regions)
|
.insert(regions)
|
||||||
.values(newRegion.data)
|
.values(newRegion.data)
|
||||||
.onConflictDoNothing({ target: regions.name })
|
.onConflictDoNothing()
|
||||||
.returning({ name: regions.name });
|
.returning({ name: regions.name });
|
||||||
if (!confirmedRegion[0]?.name) {
|
if (!confirmedRegion[0]?.name) {
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user