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

revert: remove getByDocId optional parameter #968

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Nov 18, 2024

This reverts commit 56f7e18 and replaces it with an internal-only function, nullIfNotFound.

This reverts commit 56f7e18 and
replaces it with an internal-only function, `getByDocIdIfExists`.
@EvanHahn EvanHahn force-pushed the getDocById-if-missing-wrapper branch from 34a250a to 1a0af6d Compare November 18, 2024 22:15
Comment on lines 88 to 95
getByDocId(
docId: string,
opts?: { mustBeFound?: true; lang?: string }
opts?: { lang?: string }
): Promise<TDoc & { forks: string[] }>
getByDocId(
docId: string,
opts?: { mustBeFound?: boolean; lang?: string }
): Promise<null | (TDoc & { forks: string[] })>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is part of the revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All changes to this file are just reversions.

src/roles.js Outdated
mustBeFound: false,
})
if (!roleAssignment) {
const roleRecord = await getByDocIdIfExists(this.#dataType, deviceId)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not strictly related, but I renamed this to make the diff for #188 a little smaller.

* @param {object} [opts={}]
* @param {Buffer} [opts.projectKey]
*/
async function testenv(opts = {}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was moved into a helper (see below).

@EvanHahn EvanHahn marked this pull request as ready for review November 18, 2024 22:23
EvanHahn added a commit that referenced this pull request Nov 18, 2024
@EvanHahn EvanHahn merged commit fe6fc8c into main Nov 21, 2024
9 checks passed
@EvanHahn EvanHahn deleted the getDocById-if-missing-wrapper branch November 21, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant