@@ -30,7 +30,7 @@ type ProjectResponse struct {
30
30
}
31
31
32
32
func (c * Client ) GetProject (projectID string ) (* Project , error ) {
33
- req , err := http .NewRequest ("GET" , fmt .Sprintf ("%s/v3/accounts/%s/projects/" , c .HostURL , strconv .Itoa (c .AccountID )), nil )
33
+ req , err := http .NewRequest ("GET" , fmt .Sprintf ("%s/v3/accounts/%s/projects/%s/ " , c .HostURL , strconv .Itoa (c .AccountID ), projectID ), nil )
34
34
if err != nil {
35
35
return nil , err
36
36
}
@@ -40,19 +40,13 @@ func (c *Client) GetProject(projectID string) (*Project, error) {
40
40
return nil , err
41
41
}
42
42
43
- projectListResponse := ProjectListResponse {}
44
- err = json .Unmarshal (body , & projectListResponse )
43
+ projectResponse := ProjectResponse {}
44
+ err = json .Unmarshal (body , & projectResponse )
45
45
if err != nil {
46
46
return nil , err
47
47
}
48
48
49
- for i , project := range projectListResponse .Data {
50
- if strconv .Itoa (* project .ID ) == projectID {
51
- return & projectListResponse .Data [i ], nil
52
- }
53
- }
54
-
55
- return nil , fmt .Errorf ("Did not find project ID %d in account ID %d" , projectID , strconv .Itoa (c .AccountID ))
49
+ return & projectResponse .Data , nil
56
50
}
57
51
58
52
func (c * Client ) CreateProject (name string , dbtProjectSubdirectory string , connectionID int , repositoryID int ) (* Project , error ) {
0 commit comments