Skip to content

Commit

Permalink
Prevent non-fully matching paths to match for --path
Browse files Browse the repository at this point in the history
marevers committed Mar 15, 2024
1 parent 3829567 commit af262ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pleasant/pleasant.go
Original file line number Diff line number Diff line change
@@ -175,14 +175,14 @@ func GetIdByResourcePath(baseUrl, resourcePath, resourceType, bearerToken string

if resourceType == "entry" {
for _, c := range j.Credentials {
if c.Path+resourceName == resourcePath {
if c.Path+resourceName == resourcePath && c.Name == resourceName {
count++
id = c.Id
}
}
} else if resourceType == "folder" {
for _, c := range j.Groups {
if strings.TrimSuffix(c.FullPath, "/") == resourcePath {
if strings.TrimSuffix(c.FullPath, "/") == resourcePath && c.Name == resourceName {
count++
id = c.Id
}
@@ -223,7 +223,7 @@ func GetParentIdByResourcePath(baseUrl, resourcePath, bearerToken string) (strin
var id string

for _, c := range j.Groups {
if strings.TrimSuffix(c.FullPath, "/") == parentPath {
if strings.TrimSuffix(c.FullPath, "/") == parentPath && c.Name == parentName {
count++
id = c.Id
}

0 comments on commit af262ce

Please sign in to comment.