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

Variants #127

Merged
merged 13 commits into from
Nov 13, 2024
Merged

Variants #127

merged 13 commits into from
Nov 13, 2024

Conversation

amberchow8
Copy link
Contributor

@amberchow8 amberchow8 requested a review from arath7 November 11, 2024 23:36
});
await study.updateOne({ $push: { batteries: task._id } });
const populated = await task.populate<{ battery: IBattery }>("battery");
return [200, populated];
}
};

export const getVariant = async (serverCode: string): APIResponse<object> => {

Choose a reason for hiding this comment

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

Can we specify the type of the response?

throw new HttpError(400, "Missing serverCode in query parameters");
}

const study = await Study.findOne({

Choose a reason for hiding this comment

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

This works, but I wonder if we'd be able to query directly on variants by server code rather than go through the studies themselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we can because right now variants are only contained inside the Study model

Copy link

@elvincheng3 elvincheng3 left a comment

Choose a reason for hiding this comment

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

LGTM

@amberchow8 amberchow8 merged commit 75f69c8 into main Nov 13, 2024
3 checks passed
@amberchow8 amberchow8 deleted the display-variants-122 branch November 13, 2024 20:53
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.

Display and add variants on front end Create API endpoint to return variant data based on server code
2 participants