Skip to content

Commit

Permalink
Fix URL to delete definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Lalik committed Apr 8, 2024
1 parent f1337ae commit d0ae1e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/kmi/definitionclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func (client *KMIRestClient) CreateBlockSecret(collectionName string, definition
}

func (client *KMIRestClient) DeleteDefinition(collectionName string, definitionName string) error {
idenityengineurl := fmt.Sprintf("%s/definition/Col=%s/Def=%s", client.Host, collectionName, definitionName)

idenityengineurl := fmt.Sprintf("%s/definition/Col=%s/Def=$%s", client.Host, collectionName, definitionName)
req, err := http.NewRequest("DELETE", idenityengineurl, nil)
if err != nil {
return err
Expand All @@ -65,6 +65,10 @@ func (client *KMIRestClient) DeleteDefinition(collectionName string, definitionN
return err
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusNoContent {
return fmt.Errorf("error while calling DeleteDefinition api %s and payload is %v", resp.Status, resp)
}
return nil
}

Expand Down

0 comments on commit d0ae1e7

Please sign in to comment.