Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

bradjones1
Copy link
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
);
}

Copy link
Member

@dgeb dgeb left a comment

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