diff --git a/pkg/api/org.go b/pkg/api/org.go index 78ac3c0abbd..dd3e5ad1c1c 100644 --- a/pkg/api/org.go +++ b/pkg/api/org.go @@ -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) } diff --git a/pkg/services/sqlstore/store.go b/pkg/services/sqlstore/store.go index e964f938313..ca46eceb39b 100644 --- a/pkg/services/sqlstore/store.go +++ b/pkg/services/sqlstore/store.go @@ -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)