Skip to content

feat(rule): add group promotes #1156

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

Merged
merged 4 commits into from
Aug 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions packages/client-search/src/types/Rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,29 @@ export type ConsequenceQuery = {
}>;
};

export type ConsequencePromote = {
/**
* Unique identifier of the object to promote.
*/
readonly objectID: string;

/**
* Promoted rank for the object (zero-based).
*/
readonly position: number;
};
export type ConsequencePromote =
| {
/**
* Unique identifier of the object to promote.
*/
readonly objectID: string;

/**
* Promoted rank for the object (zero-based).
*/
readonly position: number;
}
| {
/**
* List of unique identifiers for the objects to promote.
*/
readonly objectIDs: readonly string[];

/**
* Promoted start rank for the objects (zero-based).
*/
readonly position: number;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in principle we could have this in a shared type, but I wanted a different description for position if matched with an array

};

export type ConsequenceParams = {
/**
Expand Down