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

meta/catalog.latestTerm incorrectly set #37

Open
au5ton opened this issue Sep 7, 2021 · 0 comments
Open

meta/catalog.latestTerm incorrectly set #37

au5ton opened this issue Sep 7, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@au5ton
Copy link
Member

au5ton commented Sep 7, 2021

// if the catalog meta doesn't exist
if (!catalogMetaSnap.exists) {
// create catalog meta with default values (current course)
await txn.set(catalogMetaRef, {
latestTerm: record.TERM,
});
} else {
// if the catalog meta already exists, compare its term to the proposed term
if (Util.termCode(record.TERM) > catalogMetaSnap.data()!.latestTerm) {
// update the "latestTerm" value
await txn.update(catalogMetaRef, {
latestTerm: Util.termCode(record.TERM),
});
}
}

@au5ton au5ton added the bug Something isn't working label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant