Skip to content

Commit

Permalink
fix(misc): incomplete console functionality (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba authored Nov 10, 2024
1 parent 9c36362 commit 2c4da80
Show file tree
Hide file tree
Showing 79 changed files with 3,498 additions and 3,751 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/check-on-pr-idp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
- name: Set Up Bun
uses: oven-sh/setup-bun@v2
with:
node-version: '20'
bun-version: latest

- name: Install Packages
run: npm i --legacy-peer-deps
run: bun i
working-directory: idp

- name: Run TypeScript Compiler
run: npm run tsc
run: bun run tsc
working-directory: idp

- name: Run ESLint
run: npm run lint
run: bun run lint
working-directory: idp
permissions:
contents: read
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/check-on-pr-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ jobs:
mkdir ui/dist
touch ui/dist/index.html
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Set Up Bun
uses: oven-sh/setup-bun@v2
with:
node-version: '20'
bun-version: latest

- name: Install Packages
run: npm i --legacy-peer-deps
run: bun i
working-directory: ui

- name: Run TypeScript Compiler
run: npm run tsc
run: bun run tsc
working-directory: ui

- name: Run ESLint
run: npm run lint
run: bun run lint
working-directory: ui
permissions:
contents: read
Expand Down
12 changes: 6 additions & 6 deletions api/router/file_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,22 +392,22 @@ func (r *FileRouter) Probe(c *fiber.Ctx) error {

func (r *FileRouter) parseListQueryParams(c *fiber.Ctx) (*service.FileListOptions, error) {
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = FileDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
12 changes: 6 additions & 6 deletions api/router/group_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,22 @@ func (r *GroupRouter) Probe(c *fiber.Ctx) error {

func (r *GroupRouter) parseListQueryParams(c *fiber.Ctx) (*service.GroupListOptions, error) {
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = GroupDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
12 changes: 6 additions & 6 deletions api/router/insights_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,22 @@ func (r *InsightsRouter) ProbeEntities(c *fiber.Ctx) error {

func (r *InsightsRouter) parseEntityListQueryParams(c *fiber.Ctx) (*service.InsightsListEntitiesOptions, error) {
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = InsightsEntityDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
24 changes: 12 additions & 12 deletions api/router/invitation_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,22 @@ func (r *InvitationRouter) ProbeIncoming(c *fiber.Ctx) error {

func (r *InvitationRouter) parseIncomingListQueryParams(c *fiber.Ctx) (*service.InvitationListOptions, error) {
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = InvitationDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down Expand Up @@ -238,22 +238,22 @@ func (r *InvitationRouter) parseOutgoingListQueryParams(c *fiber.Ctx) (*service.
return nil, errorpkg.NewMissingQueryParamError("organization_id")
}
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = InvitationDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
12 changes: 6 additions & 6 deletions api/router/organization_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,22 @@ func (r *OrganizationRouter) Probe(c *fiber.Ctx) error {

func (r *OrganizationRouter) parseListQueryParams(c *fiber.Ctx) (*service.OrganizationListOptions, error) {
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = OrganizationDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
12 changes: 6 additions & 6 deletions api/router/snapshot_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,22 @@ func (r *SnapshotRouter) parseListQueryParams(c *fiber.Ctx) (*service.SnapshotLi
if fileID == "" {
return nil, errorpkg.NewMissingQueryParamError("file_id")
}
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = OrganizationDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
12 changes: 6 additions & 6 deletions api/router/task_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,22 @@ func (r *TaskRouter) Probe(c *fiber.Ctx) error {

func (r *TaskRouter) parseListQueryParams(c *fiber.Ctx) (*service.TaskListOptions, error) {
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = OrganizationDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
12 changes: 6 additions & 6 deletions api/router/user_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,22 @@ func (r *UserRouter) Probe(c *fiber.Ctx) error {

func (r *UserRouter) parseListQueryParams(c *fiber.Ctx) (*service.UserListOptions, error) {
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = UserDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
12 changes: 6 additions & 6 deletions api/router/workspace_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,22 @@ func (r *WorkspaceRouter) Probe(c *fiber.Ctx) error {

func (r *WorkspaceRouter) parseListQueryParams(c *fiber.Ctx) (*service.WorkspaceListOptions, error) {
var err error
var page int64
var page uint64
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.ParseUint(c.Query("page"), 10, 64)
if err != nil {
page = 1
return nil, errorpkg.NewInvalidQueryParamError("page")
}
}
var size int64
var size uint64
if c.Query("size") == "" {
size = WorkspaceDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.ParseUint(c.Query("size"), 10, 64)
if err != nil {
return nil, err
return nil, errorpkg.NewInvalidQueryParamError("size")
}
}
if size == 0 {
Expand Down
Loading

0 comments on commit 2c4da80

Please sign in to comment.