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

feat: CLIN-3507 manage add and update note and list variants with notes #96

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

meek0
Copy link
Contributor

@meek0 meek0 commented Nov 14, 2024

No new routes

Create: previous properties will be merged with newer one (if previous exists)
Filter: can filter note with either true or false e.g. /variants/filter?note=true to get ids with non null note

@meek0 meek0 force-pushed the feat/clin-3507 branch 3 times, most recently from eaf2ab2 to f910401 Compare November 18, 2024 19:45
[Op.eq]: authorId,
},
},
}).then(async function onResponse(value: VariantModel) {

Choose a reason for hiding this comment

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

Si tu utilise le await pas besoin du then, je l'écrirais plutôt sous cette forme:

Suggested change
}).then(async function onResponse(value: VariantModel) {
const variantFound = await VariantModel.findOne({
order: [['timestamp', 'DESC']],
where: {
unique_id: {
[Op.eq]: uniqueId,
},
author_id: {
[Op.eq]: authorId,
},
},
});
const variantCreated = await VariantModel.create({
unique_id: uniqueId,
organization_id: organizationId,
author_id: authorId,
properties: {
...(variantFound?.properties || {}),
...properties,
},
timestamp: new Date(),
});
return variantCreated;

@meek0 meek0 merged commit 81dd514 into main Nov 19, 2024
2 checks passed
@meek0 meek0 deleted the feat/clin-3507 branch November 19, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants