Skip to content

Commit

Permalink
feat(server): add workspace id to project in integration api (#1209)
Browse files Browse the repository at this point in the history
imp
  • Loading branch information
yk-eukarya authored Aug 23, 2024
1 parent 28c7386 commit 8ea6a52
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 76 deletions.
9 changes: 6 additions & 3 deletions server/e2e/integration_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ func TestIntegrationProjectGetAPI(t *testing.T) {
Expect().
Status(http.StatusNotFound)

e.GET(endpoint, wId0).
res := e.GET(endpoint, wId0).
WithHeader("authorization", "Bearer "+secret).
Expect().
Status(http.StatusOK).
JSON().
Object().
HasValue("page", 1).
Object()

res.HasValue("page", 1).
HasValue("perPage", 50).
HasValue("totalCount", 1).
Path("$.projects[:].id").Array().IsEqual([]string{pid.String()})

res.Path("$.projects[:].workspaceId").Array().IsEqual([]string{wId0.String()})
}
128 changes: 64 additions & 64 deletions server/internal/adapter/integration/server.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions server/pkg/integrationapi/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (

func NewProject(p *project.Project) Project {
return Project{
Alias: lo.ToPtr(p.Alias()),
CreatedAt: lo.ToPtr(p.CreatedAt()),
Description: lo.ToPtr(p.Description()),
Id: p.ID().Ref(),
WorkspaceId: p.Workspace().Ref(),
Name: lo.ToPtr(p.Name()),
Description: lo.ToPtr(p.Description()),
Alias: lo.ToPtr(p.Alias()),
CreatedAt: lo.ToPtr(p.CreatedAt()),
UpdatedAt: lo.ToPtr(p.UpdatedAt()),
}
}
13 changes: 7 additions & 6 deletions server/pkg/integrationapi/types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions server/schemas/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,9 @@ components:
id:
x-go-type: id.ProjectID
type: string
workspaceId:
x-go-type: accountdomain.WorkspaceID
type: string
name:
type: string
description:
Expand Down

0 comments on commit 8ea6a52

Please sign in to comment.