Skip to content

Commit

Permalink
📝 Change naming in venn response
Browse files Browse the repository at this point in the history
  • Loading branch information
evans-g-crsj committed Jan 27, 2025
1 parent 3229d7f commit 9dcc268
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import cors from 'cors';
import express, { Express } from 'express';
import { StatusCodes } from 'http-status-codes';
import { Keycloak } from 'keycloak-connect';

import { dependencies, version } from '../package.json';
Expand Down Expand Up @@ -31,9 +32,8 @@ import {
} from './middleware/cache';
import { injectBodyHttpHeaders } from './middleware/injectBodyHttpHeaders';
import { resolveSetIdMiddleware } from './middleware/resolveSetIdInSqon';
import { sqonContainsSet, renameFieldToFieldName } from './sqon/manipulateSqon';
import { sqonContainsSet } from './sqon/manipulateSqon';
import { resolveSetsInSqon } from './sqon/resolveSetInSqon';
import { StatusCodes } from 'http-status-codes';

export default (keycloak: Keycloak, getProject: (projectId: string) => ArrangerProject): Express => {
const app = express();
Expand Down
10 changes: 5 additions & 5 deletions src/endpoints/venn/venn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ type OutputElement = {
};

type Output = {
basics: OutputElement[];
alloys: OutputElement[];
summary: OutputElement[];
operations: OutputElement[];
};

const builder = SQONBuilder;
Expand Down Expand Up @@ -132,10 +132,10 @@ export const venn = async (sqons: string[]): Promise<Output> => {
return data.reduce(
(xs: Output, x: OutputElement) => {
if (['Q₁', 'Q₂', 'Q₃'].some(y => y === x.operation)) {
return { ...xs, basics: [...xs.basics, x] };
return { ...xs, summary: [...xs.summary, x] };
}
return { ...xs, alloys: [...xs.alloys, x] };
return { ...xs, operations: [...xs.operations, x] };
},
{ basics: [], alloys: [] },
{ summary: [], operations: [] },
);
};

0 comments on commit 9dcc268

Please sign in to comment.