Skip to content

Commit

Permalink
quick fix for positionInViewFilterGroup (twentyhq#9223)
Browse files Browse the repository at this point in the history
fix 9206

In the future, we should have a look at the column naming
"positionInViewFilterGroup"
because it breaks the SQL queries in `record-position-query.factory.ts`
for viewFilter tablenames
  • Loading branch information
guillim authored Dec 24, 2024
1 parent b52c23b commit 801bf7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,34 @@ describe('QueryRunnerArgsFactory', () => {
{
type: FieldMetadataType.POSITION,
isCustom: true,
nameSingular: 'position',
name: 'position',
},
{
type: FieldMetadataType.NUMBER,
isCustom: true,
nameSingular: 'testNumber',
name: 'testNumber',
},
{
type: FieldMetadataType.TEXT,
isCustom: true,
nameSingular: 'otherField',
name: 'otherField',
},
],
fieldsByName: {
position: {
type: FieldMetadataType.POSITION,
isCustom: true,
nameSingular: 'position',
name: 'position',
},
testNumber: {
type: FieldMetadataType.NUMBER,
isCustom: true,
nameSingular: 'testNumber',
name: 'testNumber',
},
otherField: {
type: FieldMetadataType.TEXT,
isCustom: true,
nameSingular: 'otherField',
name: 'otherField',
},
} as unknown as FieldMetadataMap,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export class QueryRunnerArgsFactory {

const shouldBackfillPosition =
options.objectMetadataItemWithFieldMaps.fields.some(
(field) => field.type === FieldMetadataType.POSITION,
(field) =>
field.type === FieldMetadataType.POSITION &&
field.name === 'position',
);

switch (resolverArgsType) {
Expand Down

0 comments on commit 801bf7c

Please sign in to comment.