working commit

This commit is contained in:
2026-03-08 21:11:45 +02:00
parent efdabf3efc
commit 2f80ce8543
29 changed files with 1437 additions and 886 deletions
+36
View File
@@ -0,0 +1,36 @@
package accntcli
import (
"context"
"encoding/json"
"errors"
"mstore/app/accoper"
"mstore/app/handler"
)
func (cli *Client) DeleteGrant(ctx context.Context, host, grantID string) error {
var err error
params := accoper.DeleteGrantParams{
GrantID: grantID,
}
reqdata, err := json.Marshal(params)
if err != nil {
return err
}
respdata, err := cli.doHTTPCall(ctx, host, "grant", "delete", reqdata)
if err != nil {
return err
}
response := handler.NewResponse[accoper.DeleteGrantResult]()
err = json.Unmarshal(respdata, response)
if err != nil {
return err
}
if response.Error {
err = errors.New(response.Message)
return err
}
return err
}