Michael Holmes
CCConvex Community
•Created by Michael Holmes on 10/19/2023 in #support-community
Is this the way to include / join a table?
I'm extending Doc<"organizationCourses"> into an interface OrganizationCourse that includes course.
3 replies
CCConvex Community
•Created by Michael Holmes on 10/18/2023 in #support-community
Excluding fields in a query?
Is doing something like this the best way to remove fields or is there a way to do this directly in the query?
import { Doc } from '../../_generated/dataModel';
const removePrivateOrganizationData = (organizations: Doc<'organizations'>[]) => {
return organizations.forEach(org => {
delete org.monthlyStripeSubscriptionId;
delete org.yearlyStripeSubscriptionId;
delete org.isApproved;
delete org.evaluationCentsLimit;
delete org.generationCentsLimit;
delete org.paymentCentsBalance;
delete org.payoutCentsBalance;
delete org.isBanned;
delete org.lastEditorId;
});
};
export default removePrivateOrganizationData;
5 replies