Skip to content

Commit

Permalink
replace gatewayId in create-gateway call
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyjux committed Jun 11, 2024
1 parent f322e01 commit 7553ab7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controllers/v3/GatewayController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import { ValidateError, FieldErrors } from 'tsoa';
import { KeystoneService } from '../ioc/keystoneInjector';
import { inject, injectable } from 'tsyringe';
import { replaceKey } from '../../batch/feed-worker';
import { gql } from 'graphql-request';
import { WorkbookService } from '../../services/report/workbook.service';
import { Namespace, NamespaceInput } from '../../services/keystone/types';
Expand Down Expand Up @@ -155,10 +156,11 @@ export class NamespaceController extends Controller {
@Body() vars: Gateway
): Promise<Gateway> {
logger.debug('Input %j', vars);
const modifiedVars = replaceKey(vars, 'gatewayId', 'name');
const result = await this.keystone.executeGraphQL({
context: this.keystone.createContext(request),
query: createNS,
variables: vars,
variables: modifiedVars,
});
logger.debug('Result %j', result);
if (result.errors) {
Expand Down

0 comments on commit 7553ab7

Please sign in to comment.