Skip to content

Commit

Permalink
fix issue with project delete trying to instantiate the sdk client
Browse files Browse the repository at this point in the history
  • Loading branch information
austin-denoble committed Jun 11, 2024
1 parent 540bcc9 commit ecdd185
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/pkg/cli/command/project/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func NewDeleteProjectCmd() *cobra.Command {
exit.Error(err)
}

verifyNoIndexes(orgName, projToDelete.Name)
verifyNoCollections(orgName, projToDelete.Name)
verifyNoIndexes(orgName, projToDelete.Id, projToDelete.Name)
verifyNoCollections(orgName, projToDelete.Id, projToDelete.Name)

if !options.yes {
confirmDelete(options.name, orgId)
Expand Down Expand Up @@ -130,9 +130,9 @@ func confirmDelete(projectName, orgId string) {
}
}

func verifyNoIndexes(orgName string, projectName string) {
func verifyNoIndexes(orgId string, projectId string, projectName string) {
// Check if project contains indexes
pc := sdk.NewPineconeClientForUserProjectByName(orgName, projectName)
pc := sdk.NewPineconeClientForProjectById(orgId, projectId)
ctx := context.Background()

idxs, err := pc.ListIndexes(ctx)
Expand All @@ -147,9 +147,9 @@ func verifyNoIndexes(orgName string, projectName string) {
}
}

func verifyNoCollections(orgName string, projectName string) {
func verifyNoCollections(orgId string, projectId string, projectName string) {
// Check if project contains collections
pc := sdk.NewPineconeClientForUserProjectByName(orgName, projectName)
pc := sdk.NewPineconeClientForProjectById(orgId, projectId)
ctx := context.Background()

collections, err := pc.ListCollections(ctx)
Expand Down

0 comments on commit ecdd185

Please sign in to comment.