code -> sqlCode
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ async function add(data) {
|
||||
const args = [ id, secret, data.name, data.appId, data.loginRedirectUri, data.tokenSignatureAlgorithm ];
|
||||
|
||||
const [error] = await safe(database.query(query, args));
|
||||
if (error && error.code === 'ER_DUP_ENTRY') throw new BoxError(BoxError.ALREADY_EXISTS, 'client already exists');
|
||||
if (error && error.sqlCode === 'ER_DUP_ENTRY') throw new BoxError(BoxError.ALREADY_EXISTS, 'client already exists');
|
||||
if (error) throw error;
|
||||
|
||||
return { id, secret };
|
||||
|
||||
Reference in New Issue
Block a user