Skip to content

Fix incorrect uses of "relationship" instead of "relation" in filtering docs#928

Merged
dgeb merged 1 commit into
orbitjs:mainfrom
bradjones1:patch-4
Feb 23, 2022
Merged

Fix incorrect uses of "relationship" instead of "relation" in filtering docs#928
dgeb merged 1 commit into
orbitjs:mainfrom
bradjones1:patch-4

Conversation

@bradjones1

Copy link
Copy Markdown
Contributor

This cost me a few minutes of head-scratching today.

See

export interface RelatedRecordFilterParam<RI = RecordIdentity> {
op?: SetComparisonOperator;
relation: string;
record: RI | RI[] | null;
}
export interface RelatedRecordsFilterParam<RI = RecordIdentity> {
op?: SetComparisonOperator;
relation: string;
records: RI[];
}
export type FilterParam<RI = RecordIdentity> =
| FilterSpecifier
| AttributeFilterParam
| RelatedRecordFilterParam<RI>
| RelatedRecordsFilterParam<RI>;
function isFilterSpecifier<RI = RecordIdentity>(
param: FilterParam<RI>
): param is FilterSpecifier {
return (param as FilterSpecifier).kind !== undefined;
}
function isAttributeFilterParam<RI = RecordIdentity>(
param: FilterParam<RI>
): param is AttributeFilterParam {
return (param as AttributeFilterParam).attribute !== undefined;
}
function isRelatedRecordFilterParam<RI = RecordIdentity>(
param: FilterParam<RI>
): param is RelatedRecordFilterParam<RI> {
return (
(param as RelatedRecordFilterParam<RI>).relation !== undefined &&
(param as RelatedRecordFilterParam<RI>).record !== undefined
);
}
function isRelatedRecordsFilterParam<RI = RecordIdentity>(
param: FilterParam<RI>
): param is RelatedRecordsFilterParam<RI> {
return (
(param as RelatedRecordsFilterParam<RI>).relation !== undefined &&
(param as RelatedRecordsFilterParam<RI>).records !== undefined
);
}

@dgeb dgeb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradjones1 thanks for the correction and sorry for the confusion!

@dgeb
dgeb merged commit 424d31a into orbitjs:main Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants