From 3e5d7d2d8675cbf8a1f1c45342067e9531a7af40 Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Fri, 22 Nov 2024 17:23:14 -0600 Subject: [PATCH] Updating gql queries for new types --- admin/routes.go | 20 +++++++------------- core/routes.go | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/admin/routes.go b/admin/routes.go index d0340d6..57846b0 100644 --- a/admin/routes.go +++ b/admin/routes.go @@ -665,8 +665,8 @@ func (s *Service) DomainUpdate(c echo.Context) error { var result GraphQLResponse op := gqlclient.NewOperation( - `mutation UpdateAdminDomain($id: Int!, $name: String!, $lookupName: String!, $orgSlug: String, $level: Int!, $status: Int! - $service: Int!, $migrate: Boolean, $isActive: Boolean!) { + `mutation UpdateAdminDomain($id: Int!, $name: String!, $lookupName: String!, $orgSlug: String, $level: DomainLevel!, $status: Int! + $service: DomainService!, $migrate: Boolean, $isActive: Boolean!) { updateAdminDomain(input: { id: $id, name: $name, @@ -793,8 +793,8 @@ func (s *Service) DomainCreate(c echo.Context) error { } op := gqlclient.NewOperation( - `mutation AddAdminDomain($name: String!, $lookupName: String!, $orgSlug: String, $level: Int!, $status: Int! - $service: Int!, $migrate: Boolean, $isActive: Boolean!) { + `mutation AddAdminDomain($name: String!, $lookupName: String!, $orgSlug: String, $level: DomainLevel!, $status: Int! + $service: DomainService!, $migrate: Boolean, $isActive: Boolean!) { addAdminDomain(input: { name: $name, lookupName: $lookupName, @@ -1092,7 +1092,7 @@ func (s *Service) DomainList(c echo.Context) error { } var result GraphQLResponse op := gqlclient.NewOperation( - `query GetAdminDomains($search: String, $after: Cursor, $before: Cursor, $filterLevel: String, $filterService: Int, $filterActive: Boolean) { + `query GetAdminDomains($search: String, $after: Cursor, $before: Cursor, $filterLevel: DomainLevel, $filterService: DomainService, $filterActive: Boolean) { getAdminDomains(input: { search: $search, after: $after, @@ -1140,19 +1140,13 @@ func (s *Service) DomainList(c echo.Context) error { } if c.QueryParam("level") != "" { - level, err := strconv.Atoi(c.QueryParam("level")) - if err != nil { - return echo.NotFoundHandler(c) - } + level := c.QueryParam("level") op.Var("filterLevel", level) gmap["selectedLevel"] = level } if c.QueryParam("service") != "" { - service, err := strconv.Atoi(c.QueryParam("service")) - if err != nil { - return echo.NotFoundHandler(c) - } + service := c.QueryParam("service") op.Var("filterService", service) gmap["selectedService"] = service } diff --git a/core/routes.go b/core/routes.go index 1d87377..93deb8d 100644 --- a/core/routes.go +++ b/core/routes.go @@ -499,7 +499,7 @@ func (s *Service) DomainCreate(c echo.Context) error { op := gqlclient.NewOperation( `mutation AddDomain( - $name: String!, $lookupName: String!, $orgSlug: String!, $service: Int!, $migrate: Boolean) { + $name: String!, $lookupName: String!, $orgSlug: String!, $service: DomainService!, $migrate: Boolean) { addDomain(input: {name: $name, lookupName: $lookupName, orgSlug: $orgSlug, service: $service, migrateLinks: $migrate}) { id -- 2.45.2