-
Notifications
You must be signed in to change notification settings - Fork 44
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: add stakeholders #142
feat: add stakeholders #142
Conversation
Thank you for following the naming conventions for pull request titles! 🙏 |
@@ -158,7 +158,7 @@ model Stakeholder { | |||
name String | |||
email String | |||
institutionName String? | |||
stakeholder_type StakeholderTypeEnum @default(INDIVIDUAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💜
href="/sample-csv/opencap-stakeholders-template.csv" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="rounded bg-gray-300/70 px-2 py-1 text-xs font-medium hover:bg-gray-400/50" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prolly need a download
attribute
<Link
download
href="/sample-csv/opencap-stakeholders-template.csv"
target="_blank"
...
if (uniqueStakeholders.length > 0) { | ||
await ctx.db.stakeholder.createMany({ | ||
data: uniqueStakeholders, | ||
skipDuplicates: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to pre-filter if we have skipDuplicates
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah, even if I wrote the skipDuplicates: true
it was still creating duplicate entries, so I wrote my own filtering.
now that I just released that the email
field in the schema should be @unique
which wasn't before.
I added a unique constraint in the email field in the schema and now it is working 👍
Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its looking great @Aashish-Upadhyay-101 , I have left few comments. Please address those and it'll be ready to merge 🚀
46554d6
to
419c74d
Compare
PR: #137