Address code review feedback
- Return 400 instead of panicking on invalid organization_id - Use generic error message for internal failures - Drop duplicate validation from initiate handler (kept in tx) - Make preserveConnectionFields mutate in place - Remove as type assertions in GoogleWorkspaceConnector - Use sort.Slice instead of sort.SliceStable - Consistent error prefixes in Slack sender Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -147,7 +147,7 @@ func (c *Connector) LoadOneByOrganizationIDAndProvider(
|
||||
}
|
||||
|
||||
// Widest-scope-wins, tiebreak by most recent updated_at.
|
||||
sort.SliceStable(connectors, func(i, j int) bool {
|
||||
sort.Slice(connectors, func(i, j int) bool {
|
||||
ci, cj := connectorScopeCount(connectors[i]), connectorScopeCount(connectors[j])
|
||||
if ci != cj {
|
||||
return ci > cj
|
||||
|
||||
Reference in New Issue
Block a user