mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 10:50:37 -06:00
Chore: Remove DeleteOrg and UpdateOrgAddress from sqlstore (#55795)
* Chore: Remove DeleteOrg and UpdateOrgAddress from sqlstore * Remove commented out methods
This commit is contained in:
parent
d1375d31cd
commit
d8cd30d22a
@ -247,9 +247,9 @@ func (hs *HTTPServer) UpdateOrgAddress(c *models.ReqContext) response.Response {
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) updateOrgAddressHelper(ctx context.Context, form dtos.UpdateOrgAddressForm, orgID int64) response.Response {
|
||||
cmd := models.UpdateOrgAddressCommand{
|
||||
OrgId: orgID,
|
||||
Address: models.Address{
|
||||
cmd := org.UpdateOrgAddressCommand{
|
||||
OrgID: orgID,
|
||||
Address: org.Address{
|
||||
Address1: form.Address1,
|
||||
Address2: form.Address2,
|
||||
City: form.City,
|
||||
@ -259,7 +259,7 @@ func (hs *HTTPServer) updateOrgAddressHelper(ctx context.Context, form dtos.Upda
|
||||
},
|
||||
}
|
||||
|
||||
if err := hs.SQLStore.UpdateOrgAddress(ctx, &cmd); err != nil {
|
||||
if err := hs.orgService.UpdateAddress(ctx, &cmd); err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update org address", err)
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ func (hs *HTTPServer) DeleteOrgByID(c *models.ReqContext) response.Response {
|
||||
return response.Error(http.StatusBadRequest, "Can not delete org for current user", nil)
|
||||
}
|
||||
|
||||
if err := hs.SQLStore.DeleteOrg(c.Req.Context(), &models.DeleteOrgCommand{Id: orgID}); err != nil {
|
||||
if err := hs.orgService.Delete(c.Req.Context(), &org.DeleteOrgCommand{ID: orgID}); err != nil {
|
||||
if errors.Is(err, models.ErrOrgNotFound) {
|
||||
return response.Error(http.StatusNotFound, "Failed to delete organization. ID not found", nil)
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ type Store interface {
|
||||
GetOrgByName(name string) (*models.Org, error)
|
||||
CreateOrg(ctx context.Context, cmd *models.CreateOrgCommand) error
|
||||
CreateOrgWithMember(name string, userID int64) (models.Org, error)
|
||||
UpdateOrgAddress(ctx context.Context, cmd *models.UpdateOrgAddressCommand) error
|
||||
DeleteOrg(ctx context.Context, cmd *models.DeleteOrgCommand) error
|
||||
GetOrgById(context.Context, *models.GetOrgByIdQuery) error
|
||||
GetOrgByNameHandler(ctx context.Context, query *models.GetOrgByNameQuery) error
|
||||
CreateUser(ctx context.Context, cmd user.CreateUserCommand) (*user.User, error)
|
||||
|
Loading…
Reference in New Issue
Block a user