mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat(projects): add new module in util package for getting project details
This commit is contained in:
19
cli/packages/util/projects.go
Normal file
19
cli/packages/util/projects.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"github.com/Infisical/infisical-merge/packages/api"
|
||||
"github.com/go-resty/resty/v2"
|
||||
)
|
||||
|
||||
func GetProjectDetails(accessToken string, workspaceId string) (api.Project, error) {
|
||||
httpClient := resty.New()
|
||||
httpClient.SetAuthToken(accessToken).
|
||||
SetHeader("Accept", "application/json")
|
||||
|
||||
res, err := api.CallGetProjectById(httpClient, workspaceId)
|
||||
if err != nil {
|
||||
return api.Project{}, err
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
Reference in New Issue
Block a user