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: add stakeholders #142

Merged
merged 14 commits into from
Mar 1, 2024

Conversation

Aashish-Upadhyay-101
Copy link
Contributor

PR: #137

Copy link

github-actions bot commented Feb 24, 2024

Thank you for following the naming conventions for pull request titles! 🙏

@Aashish-Upadhyay-101 Aashish-Upadhyay-101 changed the title Feat: add stakeholders feat: add stakeholders Feb 24, 2024
@Aashish-Upadhyay-101 Aashish-Upadhyay-101 marked this pull request as ready for review February 29, 2024 20:02
@Aashish-Upadhyay-101 Aashish-Upadhyay-101 marked this pull request as draft February 29, 2024 20:06
@Aashish-Upadhyay-101 Aashish-Upadhyay-101 marked this pull request as ready for review February 29, 2024 20:44
@Aashish-Upadhyay-101
Copy link
Contributor Author

@dahal dai, @chetannn dai
This PR is now ready for review!

@@ -158,7 +158,7 @@ model Stakeholder {
name String
email String
institutionName String?
stakeholder_type StakeholderTypeEnum @default(INDIVIDUAL)
Copy link
Contributor

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"
Copy link
Contributor

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,
Copy link
Contributor

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?

Copy link
Contributor Author

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 !

Copy link
Contributor

@dahal dahal left a 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 🚀

@dahal dahal merged commit 09a7044 into captableinc:main Mar 1, 2024
2 checks passed
@Aashish-Upadhyay-101 Aashish-Upadhyay-101 deleted the feat/add-stakeholders branch March 2, 2024 10:31
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.

None yet

2 participants