Move duplicate key error handling in ORM (#13893)
Error available in REST API <img width="1360" height="653" alt="Screenshot 2025-08-13 at 11 48 19" src="https://github.com/user-attachments/assets/a055859d-ce54-4ff6-9aba-fac48e03a98d" /> `curl http://localhost:3000/rest/people \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "emails": { "primaryEmail": "test@test.com" } }'` closes https://github.com/twentyhq/twenty/issues/13567
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ describe('formatConnectRecordNotFoundErrorMessage', () => {
|
||||
errorMessage:
|
||||
'Expected 1 record to connect to connectFieldName, but found 0 for field1 = value1 and field2 = value2',
|
||||
userFriendlyMessage:
|
||||
'Expected 1 record to connect to connectFieldName, but found 0 for field1 = value1 and field2 = value2',
|
||||
"Can't connect to connectFieldName. No unique record found with condition: field1 = value1 and field2 = value2",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+1
-1
@@ -13,6 +13,6 @@ export const formatConnectRecordNotFoundErrorMessage = (
|
||||
|
||||
return {
|
||||
errorMessage: `Expected 1 record to connect to ${connectFieldName}, but found ${recordToConnectTotal} for ${formattedConnectCondition}`,
|
||||
userFriendlyMessage: t`Expected 1 record to connect to ${connectFieldName}, but found ${recordToConnectTotal} for ${formattedConnectCondition}`,
|
||||
userFriendlyMessage: t`Can't connect to ${connectFieldName}. No unique record found with condition: ${formattedConnectCondition}`,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user