Add more unit tests for removeSSOSettings method (#78329)
* add more unit tests for remove sso settings * add unit tests for the service method
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
@@ -121,6 +122,9 @@ func (api *Api) removeProviderSettings(c *contextmodel.ReqContext) response.Resp
|
||||
|
||||
err := api.SSOSettingsService.Delete(c.Req.Context(), key)
|
||||
if err != nil {
|
||||
if errors.Is(err, ssosettings.ErrNotFound) {
|
||||
return response.Error(http.StatusNotFound, "The provider was not found", err)
|
||||
}
|
||||
return response.Error(http.StatusInternalServerError, "Failed to delete provider settings", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user