-
Notifications
You must be signed in to change notification settings - Fork 48
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
[2/2] Backend service for campaign's related news #501
[2/2] Backend service for campaign's related news #501
Conversation
Duplication of CampaignFile module and accomodated to work for the news
-Seed 5 drafts -Seed 5 published news
On the frontend side the campaign title is needed when visualizing the news for specific campaign. This change prevents unexpected behavior such as the news page crashing in case no news were found for the specific campaign, or user has visited the news page via invalid campaign slug
-Change the key to `campaignNews` to correctly represent the name of the relation -Take the latest two published articles for the campaign
…ched -Needed to accomodate the latest frontend changes for SingleArticlePage -Include article slug in listAdmin `:campaignSlug/list` endpoint
✅ Tests will run for this PR. Once they succeed it can be merged. |
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.
Great code overall!
I just have one general comment on naming:
It looks like you're using 'articles' and 'news' for the same entity - it will be great to choose one and rename the others. I'd vote for 'news' if you need my vote :)
apps/api/src/domain/generated/campaignNews/dto/create-campaignNews.dto.ts
Outdated
Show resolved
Hide resolved
const SEED_PUBLISHED_NEWS = 5 | ||
const SEED_DRAFT_NEWS = 5 |
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.
cool for adding the seeds!
@@ -0,0 +1,20 @@ | |||
-- AlterEnum | |||
ALTER TYPE "campaign_file_role" ADD VALUE 'gallery'; |
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.
nice! definitely needed for other improvements too!
It will be received by the auth header now
87b2904
to
c7a7e64
Compare
when importing external services, they need to be imported through their module
As we import the PersonModule, there is no need for injecting PersonService anymore
Complementary to #1446
Motivation and context
This PR contains the necessary backend changes to serve the campaign related news functionality
Testing
Steps to test
New endpoints
Environment
New environment variables:
NEW_ENV_VAR
: env var detailsNew or updated dependencies:
dependency/name
v1.0.0
v2.0.0